|
Can a constructor be used to change the data inside an object? A good answer might be:No. Constructors always create new objects. (They might get data from an old object, but a completely separate object will be constructed using a different chunk of main memory.) | |
Dangerously Similar ProgramHere is the example program, this time modified to create a second Point object:
Here is a picture showing the situation before and after the second assignment statement:
| |
QUESTION 14:What will this second version of the program output to the monitor? Click Here after you have answered the question |