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