Varasku

zadanie 2 dokończ

Jan 24th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. File file = new File("D://student.txt");
  2. try{
  3. FileOutputStream fout = new FileOutputStream("student.dat");
  4. DataOutputStream fout = new DataOutputStream(fout);
  5. Scanner sc = new Scanner(file);
  6. sc.useDelimiter("\\Z");
  7. while(sc.hasNext()){
  8. String [] student = sc.next().split(",");
  9. System.out.println(Arrays.toString(student));
  10. If(integer.parseInt(student[2])>=3){
  11. out.writeUTF(student[0]);
  12. out.writeUTF(student[0]);
  13. out.writeUTF(student[0]);
  14. }
  15. }
  16. out.close();
  17. }
  18. close{
  19.  
  20.  
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment