Answer the question
In order to leave comments, you need to log in
Why can't you just call clone?
Good. I’m learning Java according to Horstmann and the following question appeared. If the Object class has a clone () method protected, then I know that all sub-classes can call it. But in our case, all classes implicitly inherit the Object class, so why can’t I call?
PS: Yes, I know that it is necessary to write implements Cloneable, and rewrite the clone method, making it public.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question