} Suppose you call this method from say a class giving fileName has the input parameter the programs works fine but Occasionally it says Input file opened lot of resources . So was not sure if i do need to close the filewriter instance opened..
The basic concept is , when you declare the inner or local variable that has the same name has the class or instance variable then the inner variable shadows the outer variable. This concept is called shadowing of variables.