public Point getLocation()
{
return new Point(this.x, this.y);
}
I’ve read, from a random site, that Java optimises this piece of code to use the same object but with different values, so you will not be creating objects all the time.
Basically Java’s optimisation does is have a pointer to the Point object and just replaces the appropriate x and y values.
Is this true or have I been reading way too much crap?