Java | Functions | Question 10
Predict the output of the following program.
obj1.a = 10 obj2.a = 20
obj1.a = 20 obj2.a = 20
obj1.a = 10 obj2.a = 10
Explanation: The clone( ) method generates a duplicate copy of the object on which it is called. Only classes that implement the Cloneable interface can be cloned.
Quiz of this Question
Please comment below if you find anything wrong in the above post