Question 6
Back to Exercise
What happens when Object.clone() is called on an object whose class does not implement Cloneable?
- A A deep copy is made
- B CloneNotSupportedException is thrown Correct
- C null is returned
- D It does not compile
Correct Answer: Option B
Cloneable is a marker interface with no methods.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!