A good answer might be:A parameter is an item of data supplied to a method or a constructor. | |
Program that uses the toString() Method
The documentation shows
When this program runs, the statement:
creates a String object based on the data in the object referred to by a.
The reference variable strA keeps track of this new String object.
Then the characters from the String are sent to the monitor with println.
The program prints out:
java.awt.Point[x=0,y=0] The Point object has not been altered: it still exists and is referred to by a. Its method toString() created the characters that were printed out and stored them in a String object. (Of course, you will be eager to copy this program into Notepad and to compile and run it. Then you will almost certainly modify the program to use the toString() method with the other two objects as well.) | |
QUESTION 8:Just as the program is about to end, how many objects are there and how many object references are there? Has any garbage been created? Click Here after you have answered the question |