import java.io.File; import java.util.Scanner; public class oppg4 { public static void main(String[] args) { Scanner sc = null; try { sc = new Scanner(new File("ord.txt")); } catch (Exception e) { System.out.println("Fant ikke fik :("); System.exit(1); } String setning = ""; while (sc.hasNextLine()){ String linje = sc.nextLine(); setning = setning + linje + " "; } System.out.println(setning); sc.close(); } }