File f;
try {
  f = new File("file.txt")
  // More stuff
} catch (Exception e) {
  e.printStackTrace();
}