Does it make sense to clone an object which is supposed to be immutable ?
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers

 Q1. Does it make sense to clone an object which is supposed to be immutable ?Design
Ans. It make sense only if we intend to modify either of the object and would like to preserve original state in other. Otherwise we can reuse the original object by making it singleton.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     clone  clone objects  prototype design pattern   immutable  immutability  immutability  cloning


Related Questions

  What are different ways of object creation in Java ?
 How to avoid cloning, serialization in the singleton class ?
  What is a cloneable interface and what all methods does it contain?
  Name few classes that implement Cloneable interface ?
 Why do we use a copy constructor ?
 Why Collection interface does not extend Cloneable interface ?
 What is a prototype design pattern ?
 Difference between shallow copy and object cloning ?
 What is cloning in GIT ?



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: