I have a class which has BufferedImage as one of its fields. If i will use same BufferedImage object when creating n-times my class objects will it be same as making n BufferedImage objects or just one?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Technically, your object has a reference to a BufferedImage. It doesn’t have a BufferedImage in it and it doesn’t matter if this reference is copied 1000x or is set to null, the object will use the same amount of space and the BufferedImage will be the same too.