import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; class FilLeser { private String string = ""; public FilLeser(File fil) throws FileNotFoundException{ lesFraFil(fil); } private void lesFraFil(File fil) throws FileNotFoundException{ Scanner sc = new Scanner(fil); string += ""; while(sc.hasNextLine()){ string += sc.nextLine() + "
"; } string += ""; } public String hentString(){ return string; } }