Which among the following is true?

Which among the following is true?
A. We can use direct assignment for any object
B. We can use direct assignment only for different class objects
C. We must not use direct assignment
D. We can use direct assignment to same class objects
 
Answer: d
Explanation: The direct assignment can be used with the same class objects. There is no restriction on them. But better if the program have a predefined copy assignment operator.
 

Tìm kiếm

Back
Top