C# Interview Questions
C# Interview Questions
C# Interview Questions
1. What is C#?
C# is an object-oriented programming language compiled by the.Net framework to
generate Microsoft Intermediate Language.
Void is a type modifier which states the method and is used to specify
the return type of a method in C#.
3. What is an object?
4. Define Constructors.
• XML comments
• Example -
• Multi-line comments
• Example -
• /* example of an
• multiline comment */
12. Explain the four steps involved in the C# code compilation.
Four steps of code compilation in C# include -
• C# is component-oriented.
• It is an object-oriented language.
• The syntax is really easy to grasp.
• It is easier to learn.
• C# is part of the framework called .NET
-
• MonoDevelop
• Visual Studio Code (VS Code)
• Browxy
• Visual Studio Express (VSE)
• Visual Web Developer (VWD)
• C# is a component-oriented language.
• It is easy to pass parameters in the C# language.
• The C# language can be compiled on many platforms.
• The C# language follows a structured approach.
• It is easy to learn and pick up.
• The C# language produces really efficient and readable
programmes.
ArgumentException
ArithmeticException
DivideByZeroException
OverflowException
InvalidCastException
InvalidOperationException
NullReferenceException
OutOfMemoryException
StackOverflowException
48. How can we set the class to be inherited, but prevent the
method from being overridden?
To set the class to be inherited, it needs to be declared as
public. The method needs to be sealed to prevent any
overrides.