correct sytax?

bpayne111

Junior Contributor
Joined
Feb 28, 2003
Messages
325
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 hasn't been created shouldn't my class declaration show an error? I can do this in vb with myeyes shut but in c# i'm new so things like this bother me.
I'll 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 don't create a Clone method, it will just call the Clone method in your base class.
 
Back
Top