In Java, what would a variable of type int
hold if it was not initialized (I know that it will not let me compile if I used x
directly before initi
x in "int x" is automatically initialized as 0; x in "int [] x" is automatically initialized as null, since x is actually a reference
but compiler will prompt to initialize the variable:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The local variable a may not have been initialized
The local variable a may not have been initialized
at initialization.main(initialization.java:6)