A sealed class cannot be inherited. A sealed class is used primarily when the class contains static members. Note that a struct is implicitly sealed.
A class can inherit from one class explicitly and inherits from System.Object implicitly. It can inherit from any number of interfaces.
ShowName is static and cannot be referenced from a class instance.
ShowName.ShowMe("My Name is Ishmael");
An abstract class may contain both abstract and non-abstract methods.
new is used to replace (not override) an inherited method with one of the same name.
(a) x=60 y=40. x is passed by reference; y by value.
Include a method that performs the same operation as the operator overloading.
A class cannot be instantiated if it is abstract or if it has a private constructor.
Example event handler:
private void PrintSale(object sender, SaleEvArgs e)
decimal prc= (decimal)e.saleprice;
DateTime dt = (DateTime)e.date;
int itemNum = (int)e.itemnum;
// Now print the values
(a) Compilation error indicating that keyword new is required on Child.amethod(int, string) because it hides the inherited method. If new is used, the code prints "Base Constructor".