|
The above println() can be executed without a problem. Does this mean that the object referenced by a is copied to the monitor? A good answer might be:No---a temporary String object is created by the object's toString() method, and the characters in that object are sent to the monitor by println(). | |
Another Example ProgramHere is the example program with yet another change:
The program will print out: java.awt.Point[x=0,y=0] java.awt.Point[x=12,y=45] java.awt.Point[x=12,y=45] This program is deceptively short; its execution calls for quite a bit of activity. | |
QUESTION 11:Just as the program is about to close, how many objects have been created and how many object references are there? Has any garbage been created? Click Here after you have answered the question |