Wednesday, April 20, 2016

Question Answer

1. C# class can inherit multiple ________
Ans: Interface
2. Which of the followings are value types in C#?
Ans: 
  1. Int32
  2. Double
  3. Decimal
3. Which of the following is a reference type in C#?
Ans: String
4. What is Nullable type?
Ans: It allows assignment of null to value type.
5. Struct is a _____.
Ans: Value type
6. 10 > 9 ? “10 is greater than 9” : “9 is greater than 10” is an example of _______
Ans: Ternary operator
7. Which of the following datatype can be used with enum?
Ans: Int
8. What is indexer?
Ans: It allows an instance of a class to be indexed like an array
9. String data type is ______.
Ans: Immutable
10. An array in C# starts with _____ index.
Ans: Zero
11. Which of the following is right way of declaring an array?
Ans: Int[] intArray = new int[5];
12. Which of the following is true for ReadOnly variables?
Ans: Value will be assigned at runtime.
13. Which of the following statement is true?
Ans: 
  1. try block must be followed by catch and finally block.
  2. try block must be followed by catch or finally block or both.
  3. try block can include another try block.
14. Which of the following statement is true?
Ans: A finally block cannot include return or break keyword.
15. Func and Action are the types of ______.
Ans: Delegate
16. Return type of Predicate <T>() is always a ______.
Ans: Boolean
17. A partial class allows ________
Ans: Implementation of single class in multiple .cs files.
18. LINQ stands for ________.
Ans: Language Integrated Query
19. Data type of a variable declared using var will be assigned at _______.
Ans: Compile time
20. Which of the following is true for dynamic type in C#?
Ans: It escapes compile time type checking

No comments:

Post a Comment