BCommunity
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Inheritance differences between class and struct?

Go down

Inheritance differences between class and struct? Empty Inheritance differences between class and struct?

Post  moneymotive Thu Nov 27, 2008 1:28 pm

• a struct is implicitly sealed, a class isn't.
• a struct can't be abstract, a class can.
• a struct can't call : base() in its constructor whereas a class with no explicit base class can.
• a struct can't extend another class, a class can.
• a struct can't declare protected members (eg fields, nested types) a class can.
• a struct can't declare abstract function members, an abstract class can.
• a struct can't declare virtual function members, a class can.
• a struct can't declare sealed function members, a class can.
• a struct can't declare override function members, a class can. The one exception to this rule is that a struct can override the virtual methods of System.Object, viz, Equals(), and GetHashCode(), and ToString().
__________________
free dating
Werbegeschenke Fullservice

moneymotive

Posts : 8
Join date : 2008-11-27

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum