what is the use of clone() in real time scenario?
Answer Posted / aravindareddy
Clone() method is used to create and return copy of the
object,The Cloneable interface defines a method called Clone
(), which can be used to clone an object in your java
program.The reason for making a copy of an object is if
you’re going to modify that object and you don’t want to
modify the caller’s object. If you decide that you want to
make a local copy, you simply use the clone() method to
perform the operation.
Is This Answer Correct ? | 28 Yes | 7 No |
Post New Answer View All Answers
What is the purpose of stub and skeleton?
In case of inheritance what is the execution order of constructor and destructor?
What is a map in java?
What is the use of parseint in java?
What is the difference between a switch statement and an if statement?
Explain the difference between string, stringbuffer and stringbuilder in java?
Which is bigger float or double java?
What is the java idl system?
Why can't you declare a class as protected?
How many bits is a char?
what is meant by HQL?
What is the new line character?
Which is faster call by value or call by reference?
Which is fastest collection in java?
How do I stop concurrentmodificationexception?