C# Interview Question and Answers
6. |
What is the difference between Java and C#? |
|
- C# has more primitive data types.
- C# data types are objects.
- C# uses const to declare a class constant.
- C# supports the struct type.
- C# provides better versioning support than Java.
- C# support enumerations.
- Switch statement can have integer or string expression.
- Catch blocks should be ordered properly in C#.
|
|
|
7. |
Which namespace is used to perform the I/O operations in C#? |
|
System.Io |
|
|
8. |
Name the applications created by the C# .NET? |
|
C# can be used for a variety of applications that are supported by the .NET Platform. The most important applications are.- Console applications
- Windows applications
- Web applications
- Web services
- Developing .NET component library
|
|
|
9. |
What is for each statement in C#? |
|
- The for each statement is similar to the for statement but implemented differently.
- It is used to enumerate the contents of a collection such as array, list, and hash table.
|
|
|
10. |
What is called fall through in C#? |
|
- In the absence of the break statement in a case block, and the control move to the next case block without any problem then it is called as fall through.
- C# does not permit the fall through. Where as C, C++, Java permits.
|
|
|