What will be the result of compiling following code
public class MyClass
{
final int i ;
public static void main(
String[] arguments)
{
System.out.println(new MyClass().i);
}
}
Answer: Compilation error. variable i might not have been initialized
I was under the impression that class variables of type int have a default value of 0 if not explicitly initialized.