Advertisement
s_m4rt

Untitled

Nov 28th, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public static void wczytaj() throws FileNotFoundException{
  2. Zmienne tmp;
  3. String linia;
  4. File plik = new File("jestę_programiste.txt");
  5. Scanner scan = new Scanner(plik);
  6. while(scan.hasNext()){
  7. String str= scan.nextLine();
  8. String[] splited = str.split("\\s");
  9. for (int i=0;i<splited.length;i++){
  10. tmp = new Zmienne();
  11. tmp.Imię = splited[1];
  12. tmp.Nazwisko = splited[2];
  13. tmp.Wiek = Integer.parseInt(splited[3]);
  14. tmp.Miasto = splited[4];
  15. tmp.Stan_konta = Double.parseDouble(splited[5]);
  16.  
  17. }
  18. baza.add(tmp);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement