Hi,
I am confused about the initialization values in Java. I tried the following code and got an error:
boolean flag;
System.out.println("Printing boolean flag's value: " + flag);
Exception:
The local variable flag may not have been initialized
I assumed that flag will have false in it. I tried a boolean array and it had false in all the indexes by default.
Please guide me.
Thanks a lot.