import java.util.Scanner; import java.io.FileNotFoundException; import java.io.File; class Program01 { public static void main(String[] args) { Scanner nFile = null; try { nFile = new Scanner(new File("adat.txt"), "UTF-8"); } catch(FileNotFoundException ex) { System.err.println("Nemlétező fájl"); } String str = nFile.nextLine(); System.out.println(str); nFile.close(); } }