Inheritance differences between class and struct?
Page 1 of 1
Inheritance differences between class and struct?
• 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
• 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
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum