C# Interview Question and Answers

6. What is the difference between a class and a struct?
  The class objet is stored in the heap and struct object is stored in the stack. Therefore accessing and removing data from the struct is faster than for a class.
 
Your Name Your Email-ID
Your Answer
7. What are the access specifiers available in C#?
 
  • Private
  • Protected
  • Public
  • Internal
  • Protected Internal
 
Your Name Your Email-ID
Your Answer
8. What are delegates?
 
  • A delegates is a class derived from System.Delegate.
  • However the language has a special syntax for declaring delegates which means that they don't like classes.
  • A delegate represent a method with a particular signature.
  • An instance of a delegate represents a method with a particular signature on a particular object (or class in the case of a static method).
 
Your Name Your Email-ID
Your Answer
9. Define inheritance?
  Inheritance is deriving the new class from the already existing one.
 
Your Name Your Email-ID
Your Answer
10. What are all the data types that are not supported by CLS?
 
  • sbyte
  • uint
  • ulong
  • ushort
  • All these data types are available in C#.
 
Your Name Your Email-ID
Your Answer
12345678910 Page 2 of 10