What is method overloading in C#?

Method overloading is mechanism to create multiple methods with the same name and with unique signature in the same class. When you go for compilation, the compiler uses overload resolution to determine the specific method to be invoked.  

Mon Dec 3,2018

How is Exception Handling implemented in C#?

Exception handling is done using four keywords in C#:

1. try – It contains a block of code for which an exception will be checked.
    
2. catch – It is a program that catches an exception with the help of exception handler.
    
3. finally – It is a block of code written to execute regardless whether an exception is caught or not.
    
4. throw – It throws an exception when a problem occurs. 

Mon Dec 3,2018

What is a sealed class in C#?

When a class is declared sealed, it cannot be inherited. 

Mon Dec 3,2018

What is unboxing in C#?

When an object type is converted to a value type, it is called unboxing. 

Mon Dec 3,2018

What is boxing in C#?

When a value type is converted to object type, it is called boxing. 

Mon Dec 3,2018

What are the different types of classes in C#?

The different types of classes in C# are:

1. Partial class – Allows its members to be divided or shared with multiple .cs files. It is denoted by the keyword Partial.

2.Sealed class – It is a class which cannot be inherited. To access the members of a sealed class, we need to create the object of the class.  It is denoted by the keyword Sealed.

3.Abstract class – It is a class whose object cannot be instantiated. The class can only be inherited. It should contain at least one method.  It is denoted by the keyword abstract.

4.Static class – It is a class which does not allow inheritance. The members of the class are also static.  It is denoted by the keyword static. This keyword tells the compiler to check for any accidental instances of the static class. 

Mon Dec 3,2018
Subscribe & Get Regular Updates On Your E-mail