1.

What Is A Sealed Class?

Answer»

A sealed class is a class that cannot be inherited from. This means, If you have a class CALLED Customer that is marked as sealed. No other class can inherit from Customer class. For EXAMPLE, the below code generates a compile time error "MainClass cannot derive from sealed type Customer. USING System;

public sealed class Customer { } public class MainClass : Customer { public static VOID Main() { } }

A sealed class is a class that cannot be inherited from. This means, If you have a class called Customer that is marked as sealed. No other class can inherit from Customer class. For example, the below code generates a compile time error "MainClass cannot derive from sealed type Customer. using System;



Discussion

No Comment Found