Java | Class and Object | Question 4
(A) Compile error
values of obj1: a = 11 b = 21 values of obj2: a = 11 b = 21
values of obj1: a = 11 b = 21 values of obj2: a = 10 b = 20
values of obj1: a = 11 b = 20 values of obj2: a = 10 b = 21
(E) Run time error
Explanation: Assignment of obj2 to obj1 makes obj2 a reference to obj1. Therefore, any change in obj1 will be reflected in obj2 also.
Quiz of this Question
Please comment below if you find anything wrong in the above post
My Personal Notes arrow_drop_up
Please Login to comment...