how many types of cloning?

Answer Posted / seventh k

hey,this is core java section,isn't it?

Object's clone() is a method in JavaProgrammingLanguage,for
object duplication,to copy the functionality of a
class.Class Object's clone() creates and returns a copy of
the object,with the same class and with all the fields
having the same values.Object.clone() throws a
CloneNotSupported exception,unless u implement marker
Interface Cloneable.

two types of clonning:
1. Shallow Clonning: this is the default implementation
of Object.clone(), the clone will be a protected one.

2. Deep Cloning:classes must override clone(),to get the
Deep clonning.

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is javac in java?

558


What is variable and constant explain with example?

532


How many bits are in a sentence?

584


Is upper case in java?

529


Does java initialize arrays to zero?

508






Is java still relevant?

498


What is a subsequence of a string?

547


What are the different conditional statements?

558


difference between byte stream class and character stream class?

4081


What is difference between printf and scanf?

519


Which sorting is used in arrays sort in java?

585


What is a qms manual?

546


What are drawbacks of singleton class?

524


What happens if we override only equals?

582


What is a method signature java?

575