Sail E0 Webinar
Question
What will be the output?
public class Test{
static{
int a = 5;
}
public static void main(String args[]){
new Test().call();
}
void call(){
this.a++;
System.out.print(this.a);
}
}
Options:
A .  Compile with error
B .  Runtime Exception
C .  5
D .  6
E .  0
Answer: Option A

Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :


Latest Videos

Latest Test Papers