Programming - C++ Language

You Are Here :: Home > C++ Language > constructor - General Questions

 
49.

Which of the following statement is correct?                        


A. Constructor has the same name as that of the class. B. Destructor has the same name as that of the class with a tilde symbol at the beginning.
C. Both A and B. D. Destructor has the same name as the first member function of the class.




50.

Which of the following statement is incorrect?                        


A. Constructor is a member function of the class. B. The compiler always provides a zero argument constructor.
C. It is necessary that a constructor in a class should always be publi D. Both B and C.




51.

Which of the following statement is correct about constructors?                        


A. A constructor has a return type. B. A constructor cannot contain a function call.
C. A constructor has no return type. D. A constructor has a void return type.




52.

Which of the following statement is correct whenever an object goes out of scope?                        


A. The default constructor of the object is called. B. The parameterized destructor is called.
C. The default destructor of the object is called. D. None of the above.




53.

To ensure that every object in the array receives a destructor call, always delete memory allocated as an array with operator __________ .                        


A. destructor B. delete
C. delete[] D. kill[]




54.

Given a class named Book, which of the following is not a valid constructor?                        


A. Book ( ) { } B. Book ( Book b) { }
C. Book ( Book &b) { } D. Book (char* author, char* title) { }




« prev

1

2

3

4

5

6

7

8

9

next »

 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on