Vidyalelo
Java Programming · Q45

Declaration and Access Control

Programming · Java Programming · question 45

Q45

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);

A.
Compile with error
Answer
B.
Runtime Exception
C.
5
D.
6
E.
0

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board