Object Oriented Programming - Object Modelling - 2

146:  
C++ allows you to define the same functions more than once in the same program
A.

if the definitions are identical

B.
if the definitions are included in two separate #include files
C.
if the definitions are located in a single #include file that is included more than once
D.
C++ does not allow you to define the same functions more than once in the same program
 
 

Option: A

Explanation :

Click on Discuss to view users comments.

Write your comments here:



147:  
The operator that releases previously allocated memory is
A.

release

B.

return

C.

delete

D.

destroy

 
 

Option: D

Explanation :

Click on Discuss to view users comments.

Write your comments here:



148:  
If you create a class named SaleItem and each instantiation of the class requires 50 bytes, which of the following allocates enough memory for the SaleItem object, assuming that ptr is properly defined?  
A.

prt = new SaleItem;

B.

prt = new 50;

C.

Either (a) or (b)

D.

none of these

 
 

Option: C

Explanation :

Click on Discuss to view users comments.

Write your comments here:



149:  
If a class will serve as a base class, most often the base class data members are
A.

private

B.

protected

C.

public

D.

polymorphic

 
 

Option: D

Explanation :

Click on Discuss to view users comments.

Write your comments here:



150:  
The code class Descendant; virtual public Ancestor indicates that the members of
A.
Ancestor will be included more than once in Descendant
B.
Ancestor will be included only once in Descendant
C.
Descendant will be included more than once in Ancestor
D.
Descendant will be included only once in Ancestor.
 
 

Option: C

Explanation :

Click on Discuss to view users comments.

Write your comments here: