logo

CuriousTab

CuriousTab

Discussion


Home C++ Programming Constructors and Destructors See What Others Are Saying!
  • Question
  • Which of the following statement is correct?


  • Options
  • A. Destructor destroys only integer data members of the object.
  • B. Destructor destroys only float data members of the object.
  • C. Destructor destroys only pointer data members of the object.
  • D. Destructor destroys the complete object.

  • Correct Answer
  • Destructor destroys the complete object. 


  • More questions

    • 1. What is the technical word for the function ~CuriousTab() defined in the following program?
      #include<iostream.h> 
      class CuriousTab
      {
          int x, y; 
          public:
          CuriousTab(int xx = 10, int yy = 20 )
          {
              x = xx; 
              y = yy;
          }
          void Display()
          {
              cout<< x << " " << y << endl;
          } 
          ~CuriousTab()
          { } 
      };
      int main()
      {
          CuriousTab objCuriousTab; 
          objCuriousTab.Display(); 
          return 0;
      }

    • Options
    • A. Constructor
    • B. Destructor
    • C. Default Destructor
    • D. Function Template
    • Discuss
    • 2. Which of the following statements is correct?

      1. Once a reference variable has been defined to refer to a particular variable it can refer to any other variable.
      2. A reference is not a constant pointer.

    • Options
    • A. Only 1 is correct.
    • B. Only 2 is correct.
    • C. Both 1 and 2 are correct.
    • D. Both 1 and 2 are incorrect.
    • Discuss
    • 3. Which of the following function / types of function cannot have default parameters?

    • Options
    • A. Member function of class
    • B. main()
    • C. Member function of structure
    • D. Both B and C
    • Discuss
    • 4. How "Late binding" is implemented in C++?

    • Options
    • A. Using C++ tables
    • B. Using Virtual tables
    • C. Using Indexed virtual tables
    • D. Using polymorphic tables
    • Discuss
    • 5. Which of the following is not the member of class?

    • Options
    • A. Static function
    • B. Friend function
    • C. Const function
    • D. Virtual function
    • Discuss
    • 6. What happens when we try to compile the class definition in following code snippet?
      class Birds {};
      class Peacock : protected Birds {};

    • Options
    • A. It will not compile because class body of Birds is not defined.
    • B. It will not compile because class body of Peacock is not defined.
    • C. It will not compile because a class cannot be protectedly inherited from other class.
    • D. It will compile succesfully.
    • Discuss
    • 7. Which of the following function / type of function cannot be overloaded?

    • Options
    • A. Member function
    • B. Static function
    • C. Virtual function
    • D. Both B and C
    • Discuss
    • 8. Which of the following statement is correct?

    • Options
    • A. The default value for an argument cannot be function call.
    • B. C++ allows the redefinition of a default parameter.
    • C. Both A and B.
    • D. C++ does not allow the redefinition of a default parameter.
    • Discuss
    • 9. __________ used to make a copy of one class object from another class object of the same class type.

    • Options
    • A. constructor
    • B. copy constructor
    • C. destructor
    • D. default constructor
    • Discuss
    • 10. Which of the following statement is correct about the program given below?
      #include<iostream.h> 
      int main()
      {
          int x = 80; 
          int &y = x;
          x++;
          cout << x << " " << --y;
          return 0;
      }

    • Options
    • A. The program will print the output 80 80.
    • B. The program will print the output 81 80.
    • C. The program will print the output 81 81.
    • D. It will result in a compile time error.
    • Discuss


    Comments

    There are no comments.

Enter a new Comment