import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; class App { static Scanner scanner; public static void main(String args[]) throws Exception { try { File file = new File("adat.txt"); scanner = new Scanner(file); }catch(FileNotFoundException ex) { System.err.println(ex.getMessage()); } } }