Were the contents of x and y
altered by this conversion?
Answer:
No — new int values were created based on the information in
x and y,
and these values were used in the method call.
The variables x and y remain unchanged.
End of the Chapter
You may wish to review the following. Click on a subject that interests you to go to where it was discussed.
- Methods that do not require parameters.
- Description of parameters in class documentation
- Two ways that values in a method call are converted to the required type.
- Automatic conversion of data types in a method call.
- Rules about when a conversion is done automatically.