logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Inheritance Comments

  • Question
  • If a base class contains a member function func(), and a derived class does not contain a function with this name, an object of the derived class cannot access func().


  • Options
  • A. True
  • B. False

  • Correct Answer
  • False 

    Explanation
    It depends upon how the function func() has been defined in the base class. If the function func() is defined public in base class then an object of the derived class can access the function func().

  • Inheritance problems


    Search Results


    • 1. It is illegal to make objects of one class as members of another class.

    • Options
    • A. True
    • B. False
    • Discuss
    • 2. The way a derived class member function can access base class public members, the base class member functions can access public member functions of derived class.

    • Options
    • A. True
    • B. False
    • Discuss
    • 3. We can derive a class from a base class even if the base class's source code is not available.

    • Options
    • A. True
    • B. False
    • Discuss
    • 4. Multiple inheritance is different from multiple levels of inheritance.

    • Options
    • A. True
    • B. False
    • Discuss
    • 5. The size of a derived class object is equal to the sum of sizes of data members in base class and the derived class.

    • Options
    • A. True
    • B. False
    • Discuss
    • 6. There is no private or protected inheritance in C#.NET.

    • Options
    • A. True
    • B. False
    • Discuss
    • 7. Creating a derived class from a base class requires fundamental changes to the base class.

    • Options
    • A. True
    • B. False
    • Discuss
    • 8. A class D can be derived from a class C, which is derived from a class B, which is derived from a class A.

    • Options
    • A. True
    • B. False
    • Discuss
    • 9. An object of a derived class cannot access private members of base class.

    • Options
    • A. True
    • B. False
    • Discuss


    Comments

    There are no comments.

Enter a new Comment