Which statements about the clone() method are correct? (Choose two.) A. Calling clone() on a class that
Question:
Which statements about the clone() method are correct? (Choose two.)
A. Calling clone() on a class that does not implement Cloneable results in a compiler error.
B. Calling clone() on a class that does not implement Cloneable results in an exception at runtime.
C. If a class implements Cloneable and does not override the clone() method, then the code does not compile.
D. If a class implements Cloneable and does not override the clone() method, then an exception is thrown at runtime.
E. Overriding the clone() method in a class that implements Cloneable guarantees at least a shallow copy will be performed.
F. Overriding the clone() method in a class that implements Cloneable may result in a deep copy.
Step by Step Answer:
OCP Oracle Certified Professional Java SE 11 Developer Practice Tests Exam 1Z0 819 And Upgrade Exam 1Z0 817
ISBN: 9781119696131
1st Edition
Authors: Scott Selikoff, Jeanne Boyarsky