

MCQOPTIONS
Saved Bookmarks
1. |
What is the output of this program?
class box_Shape { int width; int height; int length; } public class mainclass { public static void main(String args[]) { box_Shape obj1 = new box_Shape(); box_Shape obj2 = new box_Shape(); obj1.height = 3; obj1.length = 4; obj1.width = 6; obj2 = obj1; System.out.println(obj2.height); } } |
A. | 3 |
B. | 2 |
C. | 1 |
D. | Runtime error |
E. | Garbage value |
Answer» B. 2 | |