|
Could two different objects contain equivalent data? A good answer might be:Yes. The objects would be constructed out of different bytes in memory, but would contain equivalent values. | |
Two Objects with Equivalent ContentsHere is a program that shows that situation:
In this program, there are two completely separate objects, each of which happens to contain character data equivalent to that in the other. Each object consists of a section of main memory completely separate from the memory that makes up the other object. The variable strA contains information on how to find the first object, and the variable strB contains information on how to find the second object. Since the information in strA is different from the information in strB,
is false, (just as it was in a previous program with two objects.) Since there are two objects, made out of two separate sections of main memory, the reference stored in strA is different from the reference in strB. It doesn't matter that the data inside the objects looks the same. | |
QUESTION 17:What will this example program print to the monitor? Click Here after you have answered the question |