.NET Interview Questions with Answers
What is Polymorphism? Answer : Polymorphism is the ability of a method, function, or object to take on different forms. It allows objects of different types to be treated as objects of a common supertype, and the correct method is invoked depending on the object’s actual type. What is Method Overloading? Answer : Method overloading is when multiple methods in the same class have the same name but different parameters (either in type, number, or both). The appropriate method is chosen based on the method signature. What is the difference between ref and out? Answer : ref : The variable must be initialized before being passed to the method. out : The variable does not need to be initialized before being passed to the method but must be assigned a value inside the method. What is the static method? Answer : A static method belongs to the type itself rather than an instance of the class. It can be called without creating an instance of the class. Why...