Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- RandomAccessFile raf = null;
- String[] split;
- String s = "";
- String imie = "";
- String nazwisko = "";
- int wiek = 0;
- try
- {
- raf = new RandomAccessFile(plik,"rw");
- while(raf.getFilePointer() < raf.length())
- {
- s = raf.readLine();
- split = s.split("-");
- for (int i = 0 ; i < split.length; i++)
- {
- imie = split[0];
- nazwisko = split[1];
- //wiek = str[2];
- }
- System.out.println("Imie = "+ imie +", Nazwisko = "+ nazwisko +", Ma "+ wiek +" lat");
- }
- }
- catch(IOException e){System.out.println("Niedziala");}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement