I am working as a trainee in Test Automation. I am working with creating Junit code with Eclipse and run using Eclipse. In that I am retriving the datas from excel sheet using FileInputStream function.
FileInputStream fi=new FileInputStream("c:\\search.xls");
Workbook w=Workbook.getWorkbook(fi);
Sheet s=w.getSheet(0);
Is it necessary to close the Inputstream function? If it so please guide me with some codings.
Yes, you need to close
the inputstream if you want your system resources released back.
FileInputStream.close()
is what you need.