1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class JavaApplication4 { /** * @param args the command line arguments */ public static void main(String[] args) throws FileNotFoundException{ Scanner sc = new Scanner(new File("c://plik.txt")); String a=""; while(sc.hasNext()) { a=a+sc.nextLine(); } System.out.print(a); } } |
Mateusz Mazurek