C#.Net Interview Question and Answers

86. What is an identifier?
  Identifiers are nothing but names given to various entities uniquely identified in a program.
87. What are the different types of literals in C#?
 
  • Boolean literals : True and False are literals of the Boolean type that map to the true and false state, respectively.
  • Integer literals : Used to write values of types Int, ulnt, long, and ulong.
  • Real literals : Used to write values of types float, double, and dedmal.
  • Character literals : Represents a single character and usually consists of a character in quotes, such as 'a'.
  • String literals : C# supports two types of string literals, regular string literal and verbatim string literals. A regular string literal consists of zero or more characters enclosed in double quotes, such as "116110". A verbatim string literal consists of an @ character followed by a double–quote character, such as ©"hello".
  • The Null literal : Represents the null–type.
88. What is meant by data encapsulation?
  Data encapsulation, also referred to as data hiding, is the mechanism whereby the implementation details of a class are kept hidden from the user. The user can only perform a restricted set of operations on the hidden members of the class by executing special functions called methods.
89. Can you override private virtual methods?
  No. Private methods are not accessible outside the class.
90. What is the main difference between a subprocedure and a function?
  Subprocedures do not return a value, while functions do.