Question:

What is Sealed Classes in c# ?

Answer:

If a class is defined as Sealed, it cannot be inherited in derived class. Example of a sealed class is given below.

public sealed class Car
{
 public Car()
 {
  Console.WriteLine("Base Class Car");
 }
 public void DriveType()
 {
  Console.WriteLine("Right Hand ");
 }
} 

Keywords:

© 2017 QuizBucket.org