When will a destructor be called?
Automatically called
At the time of object creation
when object goes out of scope
While Object decleration
Find the error, if any in the following programClass num{ int n; public ; int num( ) { n=4; } void display ( ) { count << n; }};
After public there must be a colon, constructor does not return any value.
No error
Public: is correct
main ( ) is missing
A ____ class object's class constructor is called before main() function begins to run.
Static
Global
Local
Program
What are the similarities between class and constructor?
Both are functions
Both have same name
Both are member functions
Both have same parameters
When an object of a class is created,C++ calls the constructor for that class. If no constructor is defined C++ involves a _________
Default constructor
Copy constructor
Parametrized constructor
Super class
Which of the following involves when an object is defined and initiated with another object?
Destructor
What is the need of constructor?
To initialize the object in the memory
To Create a function
To Declare an object
To define member function
When the constructors are called?
At any time
Function definition
Class creation time
What is called by the symbol '~' ?
Tilde
Underscore
Hyphen
Hash
The declaration Employee emp(10, "C++"); is :
Object
Implicit call
Object value
Explicit