import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; class Hovedprogram{ public static void main(String[] args){ File fil = new File("hei.txt"); Scanner sc = null; try { sc = new Scanner(fil); // noe ekstra } catch(FileNotFoundException e){ System.out.println(e); } System.out.println(sc.nextLine()); } }