BufferedReader file;
try
{
file = new BufferedReader(new FileReader("Users.txt"));
// tutaj wykonuję operacje na pliku
}
catch (Exception e)
{
System.err.println("Wystapil blad przy wczytywaniu danych");
e.printStackTrace();
}
file.close();
W jaki sposób zamknąć ten plik (file)?
Błędy, które wyskakują:
- Unhandled exception type IOException
- The local variable file may not have been initialized