Java OCA OCP Practice Question 1990

Question

Which exception can the clone() method of the Object class throw?.

Select the one correct answer.

(a) CloneNotSupportedException
(b) NotCloneableException
(c) IllegalCloneException
(d) NoClonesAllowedException


(a)

Note

The clone() method of the Object class will throw a CloneNotSupportedException if the class of the object does not implement the Cloneable interface.




PreviousNext

Related