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

How many bytes is a string java?

532


describe method overloading

539


What is the relationship between clipping and repainting under awt?

616


Is Java a dying language?

573


How do you download stubs from Remote place?

1359






Is vector ordered in java?

540


Can we assign integer value to char in java?

511


What is a treeset class?

560


What happens if we don’t define serial version uid?

572


What is the difference between integer parseint and integer valueof?

551


What is use of arraylist in java?

581


How many ways can we create singleton class?

506


What is the java idl system?

585


What are the default and parameterized constructors?

557


What is the use of 'super' keyword inside a constructor?

562