clone() object....

why do we need to use clone() object...
can anyone tell me sme scenario where we can use this.
an eg. can also be appreciated...

Replies

  • ashie
    ashie
    why do we need to use clone() object...
    can anyone tell me sme scenario where we can use this.
    an eg. can also be appreciated...
  • ankur8819
    ankur8819
    ashie
    why do we need to use clone() object...
    can anyone tell me sme scenario where we can use this.
    an eg. can also be appreciated...
    you do cloning if you need say a local copy of an Object.When you are going to modify the current object but you need to have previous state of your Object as well.
    Refer to
    Java Clone, Shallow Copy and Deep Copy - Javapapers
    for more info
  • Vikash Verma
    Vikash Verma
    You need to create clone of an object when you want to create a new object having same state as another existing object without calling the constructor,basically it prevents the calling of constructor for creation of new object...😎

You are reading an archived discussion.

Related Posts

I want latest topics for mini project in servelet and Jsp and also want to know new tools for jsp.
I'm new to JavaScript and I'm facing a problem with simple User login form. What I need is - -> User should enter his username, password and his role and...
i have to choose between these two as a subject for my final year. i like embedded more and iam good at it too, but DIP seems interesting as well.....
i had completed my btech(ec) with 71% am i eligible for applying for mtech in international if yes then which country is more economical?
I need some suggestions regarding alternative material for a high pressure seamless gas cylinder. The present material of cylinder is Si-Mn Steel and is to be replaced by another lightweight...