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 stored procedure. How do you create stored procedure ?

1476


What do you understand by copy constructor in java?

483


What is parse method?

522


How to use string tokenizer class.

606


What is java virtual machine and how it is considered in context of java’s platform independent feature?

635






Is logger a singleton?

511


What is class??

743


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

549


Write a factorial program using recursion in java?

497


How can you share data between two thread in Java?

512


Explain differences between checked and unchecked exceptions in java?

623


What is ternary operator? Give an example.

580


What is flag in java?

519


What is the basic difference between string and stringbuffer object?

567


What is passing parameters in java?

506