C#.Net Interview Question and Answers

11. What are the modifiers in C#?
  • Abstract
  • Sealed
  • Virtual
  • Const
  • Event
  • Extern
  • Override
  • Readonly
  • Static
  • New
Your Name Your Email-ID
Your Answer
12. What are the types of access modifiers in C#?
    Access modifiers in C# are :
  • public
  • protect
  • private
  • internal
  • internal protect
Your Name Your Email-ID
Your Answer
13. What is boxing and unboxing?
  Implicit conversion of value type to reference type of a variable is known as BOXING, for example integer to object type conversion.
Conversion of reference type variable back to value type is called as UnBoxing.
Lakshmi Narayanan, said May 13,2014
Boxing and unboxing one can link between value-types and reference-types by allowing any value of a value-type to be converted to and from type object. Eg: int i = 1; object o = i; // boxing int j = (int) o; // unboxing
Your Name Your Email-ID
Your Answer
14. What is object?
  An object is an instance of a class. An object is created by using operator new. A class that creates an object in memory will contain the information about the values and behaviours (or methods) of that specific object.
Tony Martin, said July 17, 2018
Objects are the basic run-time entities in Object Oriented System. An Object is an entity that has state, behaviour and identity. There are many object around us. Eg. A computer mouse, is an object. It is considered an object with state and behaviour.
Your Name Your Email-ID
Your Answer
15. Where are the types of arrays in C#?
  • Single-Dimensional
  • Multidimensional
  • Jagged arrays.
Tony Martin, said July 17, 2018
Multidimensional: Arrays can have more than one dimension. int[,] array = new int[4, 2]; int[, ,] array1 = new int[4, 2, 3]; Jagged arrays: Jagged Arrays in C#.NET. A jagged array is an array whose elements are arrays. The elements of a jagged array can be of different dimensions and sizes. A jagged array is sometimes called an "array of arrays." int[][] jaggedArray = new int[3][];
Your Name Your Email-ID
Your Answer