How to make more than one object refer to the same object?

How to make more than one object refer to the same object?
A. Initialize it to null
B. Initialize the object with another at declaration
C. Use constructor to create new object
D. Assign the address directly
 
Answer: b
Explanation: The object must get initialized with another object at time of declaration only. We don’t have to create a new object we just have to get name of new object because there after same address will be referred.
 

Tìm kiếm

Back
Top