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. |
|
|
7. |
What are the access specifiers available in C#? |
|
- Private
- Protected
-
Public
-
Internal
- Protected Internal
|
|
|
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).
|
|
|
9. |
Define inheritance? |
|
Inheritance is deriving the new class from the already existing one.
|
|
|
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#.
|
|
|