1. Question:What is finalizer? 

    Answer
    Finalizers are class-only methods that execute before the garbage collector reclaims the memory for an unreferenced object. 
    This is  actually C# syntax for overriding  Object’s  Finalize method. The syntax for a finalizer is the name of the class prefixed with the ~ symbol:
    class Class1
    {
    ~Class1(){...}
    }






    1. Report
  2. Question:Define Abstract classes and Abstract members. 

    Answer
    Abstract Class: An abstract class is to provide a common definition of a base class that multiple derived classes can share. It cannot be instantiated.Abstract Member : Abstract classes are able to define abstract members. Abstract members are like virtual  members,  except  they  don’t  provide  a  default  implementation






    1. Report
  3. Question:Define Enums? 

    Answer
    An enum (also named an enumeration)  is  a special value type that lets you specify a group of named numeric constants. 
    Example:
    public enum BorderSide { Left, Right, Top, Bottom }






    1. Report
  4. Question:Define Inheritance and Polymorphism. 

    Answer
    Inheritance:When a new class is inherited from another class to extend or customize the original class, the new class is called the inheritance of the original class.Polymorphism: Polymorphism, in C#, is the ability of objects of different types to provide a unique interface for different implementations of methods.






    1. Report
  5. Question:Define overridden function? 

    Answer
    An override method provides a new implementation of a member that is inherited from a base class. The method that is overridden by an override declaration is known as the overridden base method. The overridden base method must have the same signature as the override method.






    1. Report
Copyright © 2025. Powered by Intellect Software Ltd