Why do we need to close a FileInputStream (and streams in general) in any case before we leave the program? What would happen otherwise? If the program stops before
In addition to Jon's answer, it is generally a good idea to close any resource.
Think of a database connection. Your database cannot have infinite connections opened, in this case when you don't need it, it's better you close it as soon as you're done with it.
It is also good to make this a habit. "finally" block is your friend. In case of C++, you can also use RAII to manage this automatically.