Sunday 20 November 2016

C# Test

C# Test

  1. C# class can inherit multiple ________

  2. Class
    Interface
    Abstract class
    Static class

  3. Which of the followings are value types in C#?

  4. int
    double
    decimal
    All of the abovve

  5. 10 > 9 ? “10 is greater than 9” : “9 is greater than 10” is an example of _______

  6. Ternary operator
    Conditional operator
    Greater than operator
    Inverse operator

  7. What is indexer?

  8. 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 ______.

  10. Mutable
    Immutable
    Static
    Value type

  11. An array in C# starts with _____ index.

  12. 0
    1
    -1
    None of the above

  13. Which of the following is right way of declaring an array?

  14. Int[] intArray = new int[];
    Int intArray[] = new int[5];
    Int[] intArray = new int[5];
    Int[] intArray = new int[]{1, 2, 3, 4, 5};

  15. Which of the following statement is true?

  16. try block must be followed by catch and finally block both.
    try block must be followed by catch or finally block or both.
    try block cannot include another try block.
    All of the above.

  17. Data type of a variable declared using var will be assigned at

  18. Runtime
    Compile time
    CLR time
    Application Initialization time.

  19. A partial class allows ________

  20. mplementation of single class in multiple .cs files.
    Declaration of multiple classes in a single .cs file.
    Implementation of multiple interfaces to single class.
    . Multiple class inheritance.

No comments: