When i do something lile this:
BufferedImage image = otherImage;
and image
got affected otherImage
get affected too?
When i do something lile this:
BufferedImage image = otherImage;
and image
got affected otherImage
get affected too?
This is how java memory model works. All objects placed in a heap. In your methods frames you only have an access to link that refers to this objects. You can manipulate with objects via this links. Statement that you posted says that you want take the second link and refer it to the same object as first link refers.
In case you need to copy object you need to care about that by yourself. There are a few ways to achieve this. For example you can make some copying method that will take initial object, take it’s fields, create a new instance, and set fields of this newly created object to previous extracted ones.
UPD: Take a look into this. There are explanations for your concrete case with BufferedImage. But seems like the question need to be updated and marked as duplicate.