correct sytax?

bpayne111

Well-known member
Joined
Feb 28, 2003
Messages
326
Location
BFE
did i declare this inheritance and implementatoin correctly?

C#:
[Serializable()]public abstract class PieceCollectionBase:System.Collections.CollectionBase,System.ICloneable

thanks
brandon
 
looks good to me.
Implementing requires creating the Clone method and any methods or properties marked abstract in CollectionBase.
 
yes i thought it was right but i felt it was wrong for a moment so i commented out the Clone method and recompiled my class and no errors were found. If the clone method hasnt been created shouldnt my class declaration show an error? I can do this in vb with myeyes shut but in c# im new so things like this bother me.
Ill mess with it some more to see if all is well but something seemed fishy to me.
thanks
brandon
 
The only way that is possible is, you must have a base class that has a Clone() method marked as virtual. That way, if you dont create a Clone method, it will just call the Clone method in your base class.
 
Back
Top