Click to Get updated NTA UGC NET CS Test Series           Study Material for UGC NET Computer Science- 2019

Object Oriented Programming - Object Modelling

31:  
To overload a prefix ++ for a Number class, an appropriate function header is
A.
Number & Number:: operator ++ (Number & num)
B.

Number & Number:: operator ++ (int)

C.

Number & Number :: opetator ++ (int)

D.

This Number: : operator ++ (Number & num)

 
 

Option: C

Explanation :

Click on Discuss to view users comments.

Write your comments here:



32:  

The « operator is used for output only when

A.

it is used as a binary operator

B.

it is used as a unary operator

C.

cout is to the left

D.

you write a function to overload it.

 
 

Option: C

Explanation :

Click on Discuss to view users comments.

Write your comments here:



33:  

Object-oriented programmers primarily focus on

A.

procedures to be performed

B.
step-by-step statements needed to solve a problem
C.
objects and the tasks that must be performed with those objects
D.

physical orientation of objects within a program.

 
 

Option: C

Explanation :

Click on Discuss to view users comments.

Write your comments here:



34:  
If « operator has been overloaded appropriately for the class Number, and a and b are members of the Numbers class, then which statement is legal?
A.

count << a

B.

count << a << b

C.

Both (a) and (b)

D.

None of these

 
 

Option: C

Explanation :

Click on Discuss to view users comments.

Write your comments here:



35:  

Using an overloaded « operator for a class

A.
is the only way to display values of data members of a class
B.
works correctly only if all data members are private
C.
allows output statements within a program that uses the class to become simpler
D.
is possible only if the »operator is overloaded as well.
 
 

Option: C

Explanation :

Click on Discuss to view users comments.

Write your comments here:






X