Login to ZARP





TOPIC: Anyone familier with Java?

Anyone familier with Java? 8 years 11 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 11 months ago by el une spodermun.
The topic has been locked.
View BBCode

Anyone familier with Java? 8 years 11 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.
View BBCode
The following user(s) said Thank You: el une spodermun

Anyone familier with Java? 8 years 11 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.
View BBCode
Moderators: Clarky

Time to create page: 0.250 seconds

276 PLAYERS ONLINE

Connect to server View Gametracker DarkRP
8/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
3/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
265/982
Online
Top