Question Detail

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

  • Classname Objectname;
  • Class Classname Objectname;
  • Class Classname Object Objectname;
  • Classname Object Objectname;
Similar Questions :

1. Which variables cannot be declared ?

  • structure
  • pointer
  • class
  • void

2. Which of the following keywords are used to control access to a class member ?

  • protected
  • switch
  • goto
  • for

3. Destructors are called ?

  • not defined
  • in any order
  • in the reverse order of constructor calls
  • in the same order of constructor calls

4. 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

5. The advantage of declaring a virtual function as pure is
?

  • programs runs faster
  • early binding can be achieved
  • you force any derived class to define its own implementation
  • you can avoid making the class an abstract class
Read more from - C++ Programming Questions Answers - Set 2