Xufyan
-4
Posting Whiz
Recommended Answers
Jump to PostCopy constructors exist only in C++. Basically, they allow you to copy an existing object.
To do this in Java, you would need getter methods.
e.g. Birthday b=new Birthday(1, 1, 2010);
Birthday b2=new Birthday(b.getM(), b.getD(), b.getY()); <- effectively copies the "b" object
Jump to PostOr you could use the clone() method to make a copy of an object.
All 5 Replies
coil
Xufyan
-4
Posting Whiz
NormR1
563
Posting Sage
Team Colleague
coil
NormR1
563
Posting Sage
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.