http://www.lifesbizzare.blogspot.com || OCJP:81%
Matthew Brown wrote:Which variable are you talking about? z? It is actually assigned a value - the for loop assigns it to each entry of the x array in turn.
http://www.lifesbizzare.blogspot.com || OCJP:81%
Vishal Hegde wrote:No i mean X , X has not been assigned any value and its local variable and as per the definations local variables cannot have default value?
Regards, Atul.
I came to this world on a Learner's License
http://www.lifesbizzare.blogspot.com || OCJP:81%
But z is assigned a value. That is done by the for-each loop.Vishal Hegde wrote: . . . z is a local variable for that for loop and they havent been assigned any values . . .
Christophe Verré wrote:x is not a local variable, it's a method argument.
Do you think this would give you an error ?
http://www.lifesbizzare.blogspot.com || OCJP:81%
Life is full of choices. Sometimes you make the good ones, and sometimes you have to kill all the witnesses.
Jan Hoppmann wrote:When you call your method, you can't only call foo() - you need to supply a value for x.
Vishal Hegde wrote:
http://www.lifesbizzare.blogspot.com || OCJP:81%
Vishal Hegde wrote:I am simply compiling this class and its compiles (not calling foo method from anywhere)
javac Demo.java
Why is it Compiling???
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Vishal Hegde wrote:I am simply compiling this class and its compiles (not calling foo method from anywhere)
javac Demo.java
Why is it Compiling???
Vishal Hegde wrote:
Vishal Hegde wrote:
I am simply compiling this class and its compiles (not calling foo method from anywhere)
javac Demo.java
Why is it Compiling???
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |