What is Clonnable Interface in java? IS it implemented by the ProtoType Design Pattern?

Showing Answers 1 - 3 of 3 Answers

java_guy

  • Feb 27th, 2006
 

The cloneable interface is provided by java for the classes that want to suporrt the function clone or want to override it.

This function is supposed to to create and return the copy of an object.

  Was this answer useful?  Yes

mohan_slm

  • Mar 2nd, 2006
 

When you want a replica of one object and want to use it in some other scenario then we make use of Cloneable interface. Scenario where you might want clonning. say for example there is an ArrayList which has 1000 values in it. In the application you wish to show every hundred records on subsequent clicks of next button. In this scenario we clone the ArrayList to keep the original values intact and use only the cloned object to iterate. The original ArrayList which is containing 1000 values can be used at some other application.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions