1. Question: What keyword is used to declare a constant in C#?

    A
    static

    B
    const

    C
    final

    D
    readonly

    Note: Not available
    1. Report
  2. Question: Which of the following statements is true about interfaces in C#?

    A
    An interface can contain implementation of methods.

    B
    A class can implement multiple interfaces.

    C
    Interfaces can inherit from classes.

    D
    An interface cannot be instantiated.

    Note: Not available
    1. Report
  3. Question: What is the default value of a boolean variable in C#?

    A
    true

    B
    false

    C
    0

    D
    1

    Note: Not available
    1. Report
  4. Question: Which of the following is used to handle exceptions in C#?

    A
    try-catch

    B
    handle-exception

    C
    exception-try

    D
    catch-throw

    Note: Not available
    1. Report
  5. Question: What does the 'static' keyword signify in C#?

    A
    The member belongs to an instance of the class.

    B
    The member can only be accessed by the class itself.

    C
    The member can be accessed without creating an instance of the class.

    D
    The member can be overridden in derived classes.

    Note: Not available
    1. Report
  6. Question: Which of the following is NOT a built-in access modifier in C#?

    A
    public

    B
    private

    C
    protected

    D
    internalprotected

    Note: Not available
    1. Report
  7. Question: What does the 'override' keyword do in C#?

    A
    It creates a new method with the same name in a derived class.

    B
    It replaces a method in the base class with a new implementation.

    C
    It prevents a method from being overridden in derived classes.

    D
    It indicates a method is static.

    Note: Not available
    1. Report
  8. Question: In C#, which collection class is used to store key-value pairs?

    A
    List

    B
    Array

    C
    Dictionary

    D
    Queue

    Note: Not available
    1. Report
  9. Question: What is the output of the following code?
    Console.WriteLine(5 + 10 + "15");

    A
    15

    B
    1515

    C
    15 15

    D
    20

    Note: In C#, when you use the + operator, if either operand is a string, it performs string concatenation. Here, 5 + 10 evaluates to 15, and then "15" is concatenated, resulting in "1515".
    1. Report
  10. Question: Which of the following statements is true regarding the 'this' keyword in C#?

    A
    It refers to the current object in an instance method.

    B
    It can be used in static methods.

    C
    It can refer to a base class.

    D
    It is used to declare static variables

    Note: It refers to the current object in an instance method. Analysis: The this keyword is used within an instance method to refer to the current instance of the class. It cannot be used in static methods since static methods do not belong to any instance.
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd