Discussion Locked

Cloning in Java,

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Is cloning in Java, the same as what we know
in C++, returning an object by Value?

1 reply

by tc77722

From what I know it is merely an interface. It determines the behavior of Object's protected clone implementation. If a class implements Cloneable, Object's clone method returns a field-by-field copy of the object; otherwise it throws CloneNotSupportedException.

This discussion is closed to new replies.