import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.Scanner; public class Deneme { public static void main(String[] args) throws FileNotFoundException { Scanner fileIn = null; try { fileIn = new Scanner(new FileInputStream("Input.txt")); }catch (FileNotFoundException e) { System.out.println("File not found."); System.exit(0);} int sayac = 0; int i = -1; GeometrikNesne[] dizi = new GeometrikNesne[50]; //farkli txt dosyası ile de test edileceği için hoca 50 yapin dedi while (fileIn.hasNextLine()){ i ++; String x = fileIn.next(); String etiket = fileIn.next(); if(etiket.startsWith("dik")) { double en = fileIn.nextDouble(); double boy = fileIn.nextDouble(); String s = fileIn.next(); int ay = fileIn.nextInt(); int gun = fileIn.nextInt(); int yil = fileIn.nextInt(); Dikdortgen dikdortgen = new Dikdortgen(etiket, new Date(ay, gun, yil), en, boy); dizi[i] = dikdortgen; } } } }