• ( 1 ) Which of the following is not the characteristic of constructor.

    • 1) They should be declared in the public section.
    • 2) They do not have return type.
    • 3) They can not be inherited.
    • 4) They can be virtual.
    • Discussion in forum
      Answer : 4) They can be virtual.
      Solution :








      discussion


      Answer : 4) They can be virtual.

    • ( 2 ) Which of the following statement is correct?

    • 1) A constructor is called at the time of declaration of an object
    • 2) A constructor is called at the time of use of an object.
    • 3) A constructor is called at the time of declaration of a class.
    • 4) A constructor is called at the time of use of a class.
    • Discussion in forum
      Answer : 1) A constructor is called at the time of declaration of an object
      Solution :








      discussion


      Answer : 1) A constructor is called at the time of declaration of an object

    • ( 3 ) Destructors are called

    • 1) in the same order of constructor calls
    • 2) in the reverse order of constructor calls
    • 3) in any random order
    • 4) None of these
    • Discussion in forum
      Answer : 2) in the reverse order of constructor calls
      Solution :








      discussion


      Answer : 2) in the reverse order of constructor calls

    • ( 4 ) The explicit keyword is an optional decoration for the constructors that takes exactly_____argument.

    • 1) No argument
    • 2) Two
    • 3) Three
    • 4) One
    • Discussion in forum
      Answer : 4) One
      Solution :








      discussion


      Answer : 4) One

    • ( 5 ) Which of the following statement is correct whenever an object goes out of scope?

    • 1) The default constructor of the object is called.
    • 2) The parameterized destructor is called.
    • 3) The default destructor of the object is called.
    • 4) None of these
    • Discussion in forum
      Answer : 3) The default destructor of the object is called.
      Solution :








      discussion


      Answer : 3) The default destructor of the object is called.

    • ( 8 ) Explicit call to a constructor means

    • 1) Providing the constructor name explicitly to invoke it
    • 2) Not providing the construction name at all
    • 3) Is the shorthand method
    • 4) None of these
    • Discussion in forum
      Answer : 1) Providing the constructor name explicitly to invoke it
      Solution :








      discussion


      Answer : 1) Providing the constructor name explicitly to invoke it

    • ( 9 ) Destructors __________ for automatic objects if the program terminates with a call to function exit or function abort.

    • 1) are called
    • 2) are inherited
    • 3) are not called
    • 4) are created
    • Discussion in forum
      Answer : 3) are not called
      Solution :








      discussion


      Answer : 3) are not called

    • ( 10 ) A destruction function

    • 1) Takes no argument and has no return type not even void
    • 2) Has name similar to that of class, preceded by tilde(~) symbol
    • 3) Is used to destruct an object, constructed through constructor function
    • 4) All of the above
    • Discussion in forum
      Answer : 4) All of the above
      Solution :








      discussion


      Answer : 4) All of the above





Top