Answer (Choose 1 answer)
What is the output of this program?
1. class Box {
B A. Compile error
int b;
1234567 7.
int a:
int c;
}
B. Runtime error
C. 4
D. 2
class Mainclass {
public static void main(String args[])
8.{
9
10.
Box x = new Box();
Box y;
11.12.x.a = 2;x.b = 4;
13.x.c = 1;
14.y = x;
15.System.out.println(y.a);
16.}
17. }
Exit 9