Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Commons Wiki" for 
change notification.

The following page has been changed by skolima:
http://wiki.apache.org/commons/CLI

The comment on the change is:
there is a default shallow copy in .Net!

------------------------------------------------------------------------------
  }}}
  
  - In C# all classes derive from Object, just like Java. Even primitive types 
are automatically boxed and unboxed into Object-derived subclasses, just like 
Java. For a class to be cloneable it must implement the interface ICloneable 
and the method 'public object Clone()', just like Java. However, unlike Java, 
Object does not implement a shallow clone method. This means that the logic you 
implement in your own clone method cannot call the super (or base as it is in 
C#) class's Clone method to get a typed, shallow clone. This would not 
necessarily be a big deal as you could just create a new class that you are 
attempting to clone, but if you do this you would have to be able to clone its 
properties (assuming they are publicly accessible or can be set via a 
constructor) manually -- a cumbersome task.
+ 
+ '''check this.MemberwiseClone()'''
  
  You see the problem. Option is cloneable, and it relies on the Object's clone 
method. I toyed around porting this functionality via two methods. The first 
method looked like this:
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to