Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
> I believe that all classes should support a copy constructor: > public void someMethod (Foo fIsaFoo) { I'm not sure this is necessary - as far as I can see, a copy constructor doesn't provide any different semantics from clone(), so why provide it? It's not needed for by-value parameter passing as in C++, as this feature isn't supported in Java. This is covered in Thinking in Java by Bruce Eckel, IMHO one of the best Java books out there. Read it for a better explanation than I could ever give. Martin Replies: |
Sponsored Links
|