aspose file tools
The moose likes Beginning Java and the fly likes copy constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "copy constructor" Watch "copy constructor" New topic
Author

copy constructor

Pritam Chatterjee
Greenhorn

Joined: Jul 31, 2011
Posts: 13

how and why to use copy constructors? Example


Pritam
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32599
    
    4
To create an object identical to the original one.
To prevent the original being altered.Rather than returning the “real” account, you are returning a copy. That allows code to play with the account object without altering the original account object.
Pritam Chatterjee
Greenhorn

Joined: Jul 31, 2011
Posts: 13

thanks..
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32599
    
    4
You’re welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: copy constructor
 
Similar Threads
need help with a display method for an applet
Instructor's Solution to 4b
Australians: New HFSJ Book on eBay
Copy code to TextPad - no linefeeds??
Copying of column