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:What is overloading constructor? 

    Answer
    Constructor overloading in C# is a type of Static Polymorphism. Using constructor overloading, any number of constructors can be defined for the same class. But ensure each constructor must have different number and type of parameters defined.

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