Which option most fully describes will happen when you attempt to compile and run the following code..
The output is given as option 4:..why cant be the output be option 2..since i has not initialized and used here..
public class MyAr{
public static void main(
String argv[]) {
MyAr m = new MyAr();
m.amethod();
}
public void amethod(){
static int i;
System.out.println(i);
}
}
1) Compilation and output of the value 0
2) Compile time error because i has not been initialized
3) Compilation and output of null
4) Compile time error