Yes, you can't declare a variable twice.
But in the code you were asking about (#5) only one variable is declared (other than the loop variables): alpha. And it is declared just once.
The...
Type: Posts; User: pbrockway2
Yes, you can't declare a variable twice.
But in the code you were asking about (#5) only one variable is declared (other than the loop variables): alpha. And it is declared just once.
The...
Yes, exactly.
Where would you expect the error? The point is you *did* initialise both alpha and each of the alpha[i] elements. Everything initialised == no NullPointerException.
Oddly,...
When you declare a variable of an array type ("Foo[] fooArr;") it will have the value null. (But in a method or constructor you simply can't use a variable you have declared there before it is...
Nice link, by the way.
Near the bottom - and garnering zero votes :( - we read:
"In Java every things is in the form of class.
If you want to use any object then you have two phases
...
The NullPointerExpression will occur when you run the program. (Just a nitpick, but it pays to be precise...)
Could you post the stack trace: the long message that you get at the console when an...