Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void wczytaj() throws FileNotFoundException{
- Zmienne tmp;
- String linia;
- File plik = new File("jestę_programiste.txt");
- Scanner scan = new Scanner(plik);
- while(scan.hasNext()){
- String str= scan.nextLine();
- String[] splited = str.split("\\s");
- for (int i=0;i<splited.length;i++){
- tmp = new Zmienne();
- tmp.Imię = splited[1];
- tmp.Nazwisko = splited[2];
- tmp.Wiek = Integer.parseInt(splited[3]);
- tmp.Miasto = splited[4];
- tmp.Stan_konta = Double.parseDouble(splited[5]);
- }
- baza.add(tmp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement