C# Interview Question
Sealed class is class which cannot be inherited from other classes.
9) Explain sealed modifier in C#?
“Sealed” method are those methods which cannot override in the child classes.
10) Explain Static keyword in C#?
“Static” keyword can be declared in static member. If you declared class as static then all the members of the class are made static. Only one copy of static exists.
11) How the exception handling is done in C#?
We can do it with the help of “try… catch” block to handle the error/exception.
7) What is the difference between arrays and collection?
Array:
- Size of an Array is Static . It cannot resized at runtime.
- Value of the Array should be same as data type of the array.
Collection:
- Size of collection can be changed dynamically. It does not have fixed size.
- Collection can have elements of different types.
Sealed class is class which cannot be inherited from other classes.
9) Explain sealed modifier in C#?
“Sealed” method are those methods which cannot override in the child classes.
10) Explain Static keyword in C#?
“Static” keyword can be declared in static member. If you declared class as static then all the members of the class are made static. Only one copy of static exists.
11) How the exception handling is done in C#?
We can do it with the help of “try… catch” block to handle the error/exception.
12) What is object-oriented programming (OOP)?
OOP consists classes that contain properties, methods, fields, and events. It is used to create Logically Module. We create object of class to access their variables ,property and Method in another class or method. So you can say that we are using encapsulation feature with the help of object that contains the features, such as data and behavior that are associated to a class
.NET Framework supports only OOP languages, such as Visual Basic .NET, Visual C#, and Visual C++.
Kindly click on Follow me . Click here for more questions