C# Interview Question and Answers
11. |
List some of the common C# Exceptions. |
|
- Divide By Zero Exception – An attempt to divide value by zero.
- Argument out of Range Exception- Argument value is out of range.
- Arithmetic Exception – Arithmetic Overflow underflow occurs.
- Format Exception – The format of an argument is wrong.
|
|
|
12. |
What is the use of new keyword in C#? |
|
The C# allows the concept of method hiding using the keyword new. While using the new keyword in the derived class it tells the compiler to hide the base class method. The following program illustrates the use of new keyword and explains the method hiding. |
|
|
13. |
What are the features of namespace? |
|
-
Namespace is not a type.
- Namespace are implicitly public.
- The classes, struts, interfaces, enums and delegates are allowed
- Global namespace is available.
- Namespaces may be nested.
- The namespace body contains using directives and type declarations.
|
|
|
14. |
What is called stream in C#? |
|
- A Stream in C# is a path along which the data flows.
- It has data Source and a data Sink.
- The Stream concept helps in building complex file processing operations.
-
The Stream class is the parent class of all file processing operations and it is an abstract class.
|
|
|
15. |
Whether the C# support the pointer or not? |
|
- A third category of types called pointers is available for use only in unsafe code.
-
The keyword unsafe is used to perform the pointer operations with the C#.
|
|
|