Every class extends object but why it is not possible for
every object to invoke clone() method. ideally protected
methods should be accessible from sub classes. isn't it?

Answer Posted / surendrababu koppula

clone() method must be called on only cloneable objects so sub class must implement Cloneable marker interface

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you sort in descending order in java using collections sort?

507


How do you add an element to a set in java?

502


What is purpose of applet programming?

644


What is an iterator interface in java programming?

541


What is the base class for error and exception?

557






What are the data types supported by java?

550


What is the difference between scrollbar and scrollpane?

615


What is a boolean used for?

592


what is encapsulation in java? Explain

667


Is the empty set a singleton?

544


What is collection class in java? List down its methods and interfaces.

534


How many bits is size_t?

545


What is the purpose of file class?

550


What is the multi-catch block in java?

539


How to display arraylist values in java?

492