Login to ZARP
Username: Password: Remember me

TOPIC: Anyone familier with Java?

Anyone familier with Java? 8 years 4 months ago #390815

Im trying to learn Java and keep hitting this obstacle not knowing why it cant recognise the int variable epiclevel since i did set its value equal to the int variable awesomelevel multipled by 2
  • el une spodermun
  • el une spodermun's Avatar
  • Offline
  • Mythical Boarder
  • ZARP VIP
  • ex retard
  • Posts: 5119
  • Thanks received: 1318
  • Karma: 19
Last Edit: 8 years 4 months ago by el une spodermun.
The topic has been locked.

Anyone familier with Java? 8 years 4 months ago #390816

The issue is line 7:

awesomeLevel = epicLevel;
int epicLevel = (awesomeLevel * 2);

You can't give a variable a value of a variable which hasn't been assigned yet. Some languages allow this, but not Java.
  • Stryxic
  • Stryxic's Avatar
  • Offline
  • Fresh Boarder
  • ZARP VIP
  • Posts: 18
  • Thanks received: 1
  • Karma: 0
The topic has been locked.
The following user(s) said Thank You: el une spodermun

Anyone familier with Java? 8 years 4 months ago #390817

Stryxic wrote:
The issue is line 7:

awesomeLevel = epicLevel;
int epicLevel = (awesomeLevel * 2);

You can't give a variable a value of a variable which hasn't been assigned yet. Some languages allow this, but not Java.
thank you
  • el une spodermun
  • el une spodermun's Avatar
  • Offline
  • Mythical Boarder
  • ZARP VIP
  • ex retard
  • Posts: 5119
  • Thanks received: 1318
  • Karma: 19
The topic has been locked.
Time to create page: 0.245 seconds

125 PLAYERS ONLINE

Connect to server View Gametracker DarkRP 1
12/127
online
Connect to server View Gametracker Deathrun
0/40
online
Connect to server View Gametracker TTT
0/47
online
Connect to server View Gametracker Bhop
0/32
online
Connect to server View Gametracker Surf
0/32
online
Connect to server View Gametracker Prop Hunt
0/42
online
Connect to server View Gametracker Sandbox
0/42
online
Connect to server Discord
113/944
online
Top