Quiz: Classes & Objects

To View Tricks: Login Required

Number of Questions: 25

Question: 11 -

Which of the following statements is correct when a class is inherited publicly?

Options:
  1. Public members of the base class become private members of derived class.

  2. Public members of the base class become public members of derived class.

  3. Public members of the base class become protected members of derived class.

  4. Private members of the base class become protected members of derived class.

  5. Answer:

    Public members of the base class become public members of derived class.

    Solution not available.

Question: 12 -

Which of the following access specifies is used in a class definition by default?

Options:
  1. Private

  2. Protected

  3. Friend

  4. Public

  5. Answer:

    Private

    Solution not available.

Question: 13 -

Which of the following two entities (reading from Left to Right) can be connected by the dot operator?

Options:
  1. A class object and a member of that class.

  2. A class object and a class.

  3. A class member and a class object.

  4. A class and a member of that class.

  5. Answer:

    A class object and a member of that class.

    Solution not available.

Question: 14 -

Which of the following statements is correct about the constructors and destructors?

Options:
  1. Constructors and destructors can both return a value.

  2. Destructors can take arguments but constructors cannot.

  3. Destructors can be overloaded but constructors cannot be overloaded.

  4. Constructors can take arguments but destructors cannot.

  5. Answer:

    Constructors can take arguments but destructors cannot.

    Solution not available.

Question: 15 -

Which of the following statements is incorrect?

Options:
  1. Friend keyword can be used for a function in the public section of a class.

  2. Friend keyword can be used for a function in the private section of a class.

  3. Friend keyword can be used on main().

  4. Friend keyword can be used in the class to allow access to another class.

  5. Answer:

    Friend keyword can be used on main().

    Solution not available.