import java.util.StringTokenizer; import java.io.*; import java.util.NoSuchElementException; class SisseLugeja{ public int[] x=new int[10], y=new int[10], l=new int[10], p=new int[10]; public int i=0; public SisseLugeja(){ try{loeSisse();}catch(Exception jama){System.out.println("ei õnnestunud");} } public void loeSisse() throws IOException{ String rida; int mitu_rida=0; BufferedReader sisse=new BufferedReader(new FileReader("andmed.txt")); while((rida=sisse.readLine())!=null){ StringTokenizer tokeniiser=new StringTokenizer(rida); try{ x[i]=Integer.parseInt(tokeniiser.nextToken()); y[i]=Integer.parseInt(tokeniiser.nextToken()); l[i]=Integer.parseInt(tokeniiser.nextToken()); p[i]=Integer.parseInt(tokeniiser.nextToken()); i++; }catch(NoSuchElementException jama){System.out.println("tead, mingi jama oli:(");} } sisse.close(); } }