import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class LeseFraFil { public static void main(String[] args) throws FileNotFoundException { File fil = new File("minFil.txt"); // hente fil Scanner scanner = new Scanner(fil); // lese filen while (scanner.hasNextLine()){ // kj?rer s? lenge det finnes en linje til String linje = scanner.nextLine(); System.out.println(linje); } scanner.close(); } }