IDNIL QUIZ C# Test


1. C# class can inherit multiple ________
Class
Interface
Abstract Class
Static Class

2. Which of the followings are value types in C#?
Int32
Double
Decimal
All of the above

3. Which of the following is a reference type in C#?
String
Long
Boolean
All of the above

4. What is Nullable type?
It allows assignment of null to reference type.
It allows assignment of null to value type.
It allows assignment of null to static class.
None of the above.

5. Struct is a _____.
Reference type
Value type
Class type
String type

6. 10 > 9 ? "10 is greater than 9” : "9 is greater than 10” is an example of _______
Ternary operator
Conditional operator
Greater than operator
Inverse operator

7. Which of the following datatype can be used with enum?
Int
String
Boolean
All of the Above

8. What is indexer?
It allows an instance of a class to be indexed like an array
It allows enumerator with class
It creates index for instances of a class.
None of the above.

9. String data type is ______.
Mutable
Immutable
Static
Value type

10. An array in C# starts with _____ index.
One
Zero
-1
None of the above

11. Which of the following is right way of declaring an array?
int[] intArray = new int[];
int intArray[] = new int[5];
int[] intArray = new int[5];
int[5] intArray = new int[];

12. Which of the following is true for ReadOnly variables?
Value will be assigned at runtime.
Value will be assigned at compile time.
Value will be assigned when it accessed first time
None of the above

13. Which of the following statement is true?
try block must be followed by catch or finally block or both.
finally block cannot include return statement.
try block can include another try block.
All of the above.

14. Return type of Predicate <T>() is always a ______.
Integer
String
Boolean
Void

15. Data type of a variable declared using var will be assigned at _______.
Runtime
Compile time
CLR time
Application Initialization time.

16. Which of the following is true for dynamic type in C#?
It allows multiple time declaration of a variable.
It allows compile time type checking
It escapes compile time type checking
None of the above.

17. Q
a
b

18. dsa
a
c
b

19. hdaksjlndsa?
yes
no
ytit

20. sa
a
v

21. Who when 2018 world cup?
Croatia
France
Belgium
England

22. Are yo there ?
Yes, I m
Not Now
May be

23.