Java - Does "new FileInputStream" need to be closed?
<p>In this code:</p>

<pre><code>Properties prop = new Properties();
prop.load(new FileInputStream("config.properties"));
</code></pre>

<p>Some properties are loaded, but does the fileinputstream need to be closed or does it somehow take care of that itself?</p>

<p>Do I need to create a variable, new file inputstream, then close the variable?</p>

<p>I was also wondering, if I create a variable, say, <code>String a = null</code> and <code>int b</code>;
Do they consume memory when they hold nothing?</p>

<p>and if I have that inside a method or a loop, does it still consume memory when out of scope?</p>

<p>I think someone once said it's loaded into memory but not 'active'?</p>
