public void hesapEkle() {
System.out.println("Oluşturmak istediğiniz hesap türünü seçiniz:");
System.out.println("1. Vadeli Hesap");
System.out.println("2. Vadesiz Hesap");
Scanner getInput = new Scanner(System.in);
int acilacakHesapTuru = getInput.nextInt();
getInput.close();
String hesapTuru;
System.out.println("Hesap turu girin (Maas / Normal):");
Scanner getInput1 = new Scanner(System.in);
hesapTuru = getInput1.nextLine();
getInput1.close();
if((hesapTuru != "Maas") && (hesapTuru != "Normal")) {
System.out.println("Girilen hesap turu gecersiz oldugundan normal hesap olarak tanimlandi.");
hesapTuru = "Normal";
}
}
Hesap turu girin (Maas / Normal)
Exception in thread "main" java.util.NoSuchElementException: No line found at Musteri.hesapEkle(Musteri.java:65)
Here is my output^^ Why can't i get another input except acilacakHesapTuru variable? ......................................................................................................................................................................................................................................................................................................................................................