knugi

Untitled

Apr 26th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. package zzTests;
  2.  
  3. import java.io.File;
  4. import java.io.FileNotFoundException;
  5. import java.io.PrintWriter;
  6. import java.util.Scanner;
  7.  
  8. public class Zadanie {
  9. public static void main(String[] args) throws FileNotFoundException{
  10. String sFile = "config.txt";
  11.  
  12. File file = new File(sFile);
  13. PrintWriter pw = new PrintWriter(file);
  14. Scanner in = new Scanner(System.in);
  15. Scanner out = new Scanner(file);
  16. pw.print(in.nextLine());
  17. pw.close();
  18. in.close();
  19. while(out.hasNextLine()){
  20. System.out.println(out.nextLine());
  21. }
  22. out.close();
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment