Core Java - Interview Questions and Answers for 'Cloneable' | Search Interview Question - javasearch.buggybread.com
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

   



Core Java - Interview Questions and Answers for 'Cloneable' - 5 question(s) found - Order By Newest

 Q1. How to avoid cloning, serialization in the singleton class ?Design
Ans. For Cloning-exception,For deserialization-read.resolve()

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

   Like         Discuss         Correct / Improve     singleton  cloneable  serializable  serialization  cloning     Asked in 1 Companies


 Q2. What is a cloneable interface and what all methods does it contain?Core Java
Ans. Cloneable is a declaration that the class implementing it allows cloning or bitwise copy of it's object state. It is not having any method because it is a MARKER interface.

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

   Like         Discuss         Correct / Improve     java   oops   cloneable   marker interface  cloning     Asked in 2 Companies


 Q3. Name few classes that implement Cloneable interface ?
Ans. http://www.buggybread.com/2015/02/java-collections-classes-that-implement_58.html

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

   Like         Discuss         Correct / Improve     java   cloneable  cloning


 Q4. Why Collection interface does not extend Cloneable interface ?Core Java
Ans. Here is the list of classes that implements Collections Interface - http://www.buggybread.com/2015/02/java-collections-classes-that-implement.html

Having Collection interface to extend Cloneable interface would mean necessarily implement clone method by all implementing classes. As not all collection classes allow duplicate elements, it makes no sense to clone elements for them.

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

   Like         Discuss         Correct / Improve     cloneable  collections  collection interface  cloning


 Q5. What is the default data type of state variables in Clonable interface and Serializable interface ?Core Java
Ans. Cloneable and Serializable are Marker Interfaces, So these are empty interfaces with no variables.

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

   Like         Discuss         Correct / Improve     cloneable  serializable  static variables     Asked in 1 Companies



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: