File file = new File ("image.gif");
// Is this a copy, a reference, or something else?
File File2 = file;
What I'm trying to do is copy a reference to a File object. I don't want to make a duplicate and I'm not sure if the above code is copying a reference or copying the object. I'm trying to avoid memory leaks or orphans, especially if I were to delete the file from within the code.
Thank you.