Amit Jain
difference between sealed class and abstract class?
By Amit Jain in ASP.NET on Jul 20 2007
  • Maggi
    Oct, 2010 2

    Hi,


    Sealed and abstract are the keywords used in .Net framework.

    Sealed class : A sealed class can not be inherited in other words, no class can be derived from the sealed class. 

    Basically used for commercial reasons where restrictions are implemented on the class so that no one use the existing class and derive from it without the license.

    If a method is declared as sealed it can not be overridden. Used to avoid instability of some major code.

    Abstract Class : A class that contains atleast one abstract method and uses a keyword abstract is a abstract class. It may or may not have the non abstract methods. This class can be inherited.

    Abstract method means that the method does not have any implementation..it just contains the signature of method. The abstract method is required to be implemented in the derived class.



    • 0
  • madhu sudan kumbakonam
    Jul, 2007 20

    hei sealed class is one which cannot act as base class.ie u cannot derive a class from it.where as abstract class is a one contains abstract methods & non abstract methods.abstract method is one which doesnt have any implementation.class deriving from abstract class has to provide implementation for bstract methods.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS