Quiz: Classes & Objects

To View Tricks: Login Required

Number of Questions: 25

Question: 16 -

Which of the following keywords is used to control access to a class member?

Options:
  1. Protected

  2. Asm

  3. Default

  4. Break

  5. Answer:

    Protected

    Solution not available.

Question: 17 -

Which of the following statement is correct with respect to the use of friend keyword inside a class?

Options:
  1. We can use friend keyword as a class name.

  2. A class may be declared as a friend.

  3. A private data member can be declared as a friend.

  4. An object may be declared as a friend.

  5. Answer:

    A class may be declared as a friend.

    Solution not available.

Question: 18 -

Which of the following also known as an instance of a class?

Options:
  1. Object

  2. Friend Functions

  3. Member Functions

  4. Member Variables

  5. Answer:

    Object

    Solution not available.

Question: 19 -

Which of the following can access private data members or member functions of a class?

Options:
  1. All global functions in the program.

  2. Any function in the program.

  3. Only public member functions of that class.

  4. Any member function of that class.

  5. Answer:

    Any member function of that class.

    Solution not available.

Question: 20 -

Which of the following type of data member can be shared by all instances of its class?

Options:
  1. Static

  2. Friend

  3. Public

  4. Inherited

  5. Answer:

    Static

    Solution not available.