1 public class As{
2 int i = 10;
3 int j;
4 char z= 1;
5 boolean b;
6 public static void main(
String argv[]){
7 As a = new As();
8 a.amethod(); }
9 public void amethod(){
10 System.out.println(j);
11 System.out.println(b);
12 }
3 }
1) Compilation succeeds and at run time an output of 0 and false
2) Compilation succeeds and at run time an output of 0 and true
3) Compile time error b is not initialised
4) Compile time error z must be assigned a char value
The answer is 1, but shouldn't be answer as 4 'coz we are assigning int to char in line 4.
I compiled this and i am getting results 0 and false.
Any comments?