Home / C# Programming / Polymorphism :: General Questions

C# Programming :: Polymorphism

  1. Which of the following operators cannot be overloaded?

    1. true
    2. false
    3. new
    4. ~
    5. sizeof

  2. A.
    1, 3
    B.
    2, 4
    C.
    3, 5
    D.
    All of the above

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Which of the following modifier is used when a virtual method is redefined by a derived class?

  4. A.

    overloads

    B.

    override

    C.

    overridable

    D.

    virtual

    E.

    base

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. In order for an instance of a derived class to completely take over a class member from a base class, the base class has to declare that member as

  6. A.
    new
    B.
    base
    C.
    virtual
    D.
    overrides
    E.
    overloads

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Which of the following can be declared as a virtual in a class?

    1. Methods
    2. Properties
    3. Events
    4. Fields
    5. Static fields

  8. A.

    1, 2, 3

    B.

    3, 5

    C.

    2, 4

    D.

    2, 3, 5

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. Which of the following statements is correct?

  10. A.
    Only one object can be created from an abstract class.
    B.
    By default methods are virtual.
    C.
    If a derived class does not provide its own version of virtual method then the one in the base class is used.
    D.
    If the method in the derived class is not preceded by override keywords, the compiler will issue a warning and the method will behave as if the override keyword were present.
    E.
    Each derived class does not have its own version of a virtual method.

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. Which of the following are necessary for Run-time Polymorphism?

    1. The overridden base method must be virtual, abstract or override.
    2. Both the override method and the virtual method must have the same access level modifier.
    3. An override declaration can change the accessibility of the virtual method.
    4. An abstract inherited property cannot be overridden in a derived class.
    5. An abstract method is implicity a virtual method.

  12. A.

    1, 3

    B.

    1, 2, 5

    C.

    2, 3, 4

    D.

    4 only

    View Answer

    Workspace

    Discuss Discuss in Forum