Question Detail

The private data members of a class are accessible ?

  • Directly to objects of that class
  • To any function defined outside a class
  • Only to the member functions
  • Only using keyword static
Similar Questions :

1. A virtual base class ?

  • is qualified as virtual in base class definition.
  • do not qualified as virtual in base class definition.
  • allows to inherit more than one copy of the base class members.
  • strict the path of inheritance.

2. Even if we define a function in a class, then also we need to declare it first.

  • True
  • False

3. Which variables cannot be declared ?

  • structure
  • pointer
  • class
  • void

4. Inheritance is referred to as

  • “is a” relationship
  • "have a" relationship
  • both of above
  • none of above

5. Which among following is correct way of declaring object of a class ?

  • Classname Objectname;
  • Class Classname Objectname;
  • Class Classname Object Objectname;
  • Classname Object Objectname;
Read more from - C++ Programming Questions Answers - Set 2