The Artima Developer Community
Sponsored Link

Java Answers Forum
copy constructor,Wrapper classes

3 replies on 1 page. Most recent reply: May 22, 2005 5:30 PM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Harikrishnan

Posts: 1
Nickname: h8008767
Registered: May, 2005

copy constructor,Wrapper classes Posted: May 22, 2005 1:54 AM
Reply to this message Reply
Advertisement
what do u mean by Copy constuctor and whether Copy Constuctor is available in JAVA?,explain abt Wrapper Class with Illustration?


Venu Vinjamoori

Posts: 2
Nickname: vinjamoori
Registered: May, 2005

Re: copy constructor,Wrapper classes Posted: May 22, 2005 3:44 AM
Reply to this message Reply
Hi,

I have never used a copy constructor but an example of it being used could be an application with an undo function. Say a user is presented with an object on a screen and changes several fields. We might want our undo function to reverse each user change in reverse sequence for the number of times the user invokes it. To implement this we would take a copy of the object each time the user changed the object and store the copied object in a stack. When the user invokes the undo function we can replace the currently shown object with the first one off the top of the stack

Venu Vinjamoori

Posts: 2
Nickname: vinjamoori
Registered: May, 2005

Re: copy constructor,Wrapper classes Posted: May 22, 2005 3:52 AM
Reply to this message Reply
that is used to initialize the values of new object with value of the existing object.

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: copy constructor,Wrapper classes Posted: May 22, 2005 5:30 PM
Reply to this message Reply
plz buy a copy of Effective Java 4 u self.

Flat View: This topic has 3 replies on 1 page
Topic: Problem on Socket Program Previous Topic   Next Topic Topic: write method gets  blocked while communicating to COM port

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use