If clone()
is a part of the Object
class , then why do we need to implement Clonable
interface to use clone()
?
I have read that clone()
is protected member of Object
, then what is the relationship between clone()
and Clonable
interface.
Sorry if I sound stupid. I have just began learning Java.