K
Kevin Kirkeby
I have usually gotten properties from a file as follows:
properties.load(new FileInputStream(propFile));
After I'm finished I just return from the method that invoked the above
statement. I've been assuming that after I exit my method, the garbage
collector *should* clean things up; however, am I incorrect in this
assumption? i.e. are resources not being released?
Is this a bad programming practice or should I do more of the following:
FileInputStream fis = new FileInputStream(propFile);
properties.load(fis);
fis.close();
Thanks!
properties.load(new FileInputStream(propFile));
After I'm finished I just return from the method that invoked the above
statement. I've been assuming that after I exit my method, the garbage
collector *should* clean things up; however, am I incorrect in this
assumption? i.e. are resources not being released?
Is this a bad programming practice or should I do more of the following:
FileInputStream fis = new FileInputStream(propFile);
properties.load(fis);
fis.close();
Thanks!