C#.Net Interview Question and Answers

91. How does C# differ from C++?
  • C# does not support #include statement. It uses only using statement.
  • In C# , class definition does not use a semicolon at the end.
  • C# does not support multiple code inheritance.
  • Casting in C# is much safer than in c++.
  • In C# switch can also be used on string values.
  • Command line parameters array behave differently in C# as compared to C++.
92. What is nested class?
  • A Nested classes are classes within classes.
  • A nested class is any class whose declaration occurs within the body of another class or interface.
93. Can you have parameters for static constructors?
  No, static constructors cannot have parameters.
94. Is String is Value Type or Reference Type in C#?
  String is an object(Reference Type).
95. Does C# provide copy constructor?
  No, C# does not provide copy constructor.