C# Interview Question and Answers

46. Differentiate between value types with reference types?
 
    Value Type : These data types store their data directly as values in memory. Includes
  • Numeric Types (int 32, short, single).
  • Structures (Custom data types based on System.ValueType).
  • Enumerations(Custom types that represent a defined set of Values).
  • 4. Boolean, char can be accessed directly.
    Reference Type :These data types store reference to another memory location that contains the data.
  • Object
  • String
  • Arrays
  • Can be accessed through the members of the class.
 
Your Name Your Email-ID
Your Answer
47. Define scope?
  Scope refers to the region of code in which a variable may be accessed.
 
Your Name Your Email-ID
Your Answer
48. What are all the different levels of scoping?
 
  • Block Level – Variables declared within an If… Then, For … Next, Do… Loop block.
  • Procedure Level – Variables declared within the procedures.
  • Module Level – Variables declared outside of a procedure.
  • Namespace Level – Variables declared outside of a procedure, but given public accessibility (Public or Friend).
 
Your Name Your Email-ID
Your Answer
49. Is C# is object oriented?
  Yes, C# is an OO language in the tradition of Java and C++.
 
Your Name Your Email-ID
Your Answer
50. What does the keyword static mean when applied to a class member?
  It means the method can be called through the class without instantiating the class.
 
Your Name Your Email-ID
Your Answer
12345678910 Page 10 of 10