Many of us think starting with the command prompt is the best way.
Try writing some classes in packages and using them to see how to use classpath.
Just simple "Hello world" classes but with...
Type: Posts; User: Norm
Many of us think starting with the command prompt is the best way.
Try writing some classes in packages and using them to see how to use classpath.
Just simple "Hello world" classes but with...
That error is called shadowing: having a local variable with the same name as a class variable.
I don't know why IDEs don't give a warning when it is done. I can't think of a time that you would...
Same question as before, now for line 23. What variable is null?
This code ( fighter1.health) uses two variables:
fighter1
and
fighter1.health
health is an int which can NOT have a null...
What variable has the null value? If you can't tell by looking, use a println statement to print out the values of the variables so you can see. Add the println immediately before where the error...
At line 26 in fightGame there was a variable with a null value when that statement was executed. Find the variable with the null value and backtrack in the code to see why that variable didn't have...