Pass a clone of the Point object to the modifyPoint method.
Make the Point object immutable.
</blockquote> My question is, how do you make an object "immutable"?
posted 14 years ago
Hi, if you make the method signature "final public static void modifyPoint(final Point pt, int j)" then the method cant change the copy of the object reference. But if you have methods in the object class that changes members within the object the final key word dosent protect that, that is if you call these methods in the "modifyPoint()" method (i think ) excuse me for my bad english hope it helps Rille