Hi All,
i build a superclass called Shoes, and some subclasses. One of them is "askerayakkabi" .
what i want to make is, i use scanner system.in and making user to enter askerayakkabi if they enter after they have to enter size and color. if they choose the askerayakkabi. but the problem is first scanner method for ' String ayakkabituru = cesit.nextLine();' is working. and i can enter the askerayakkabi... after wrote to askerayakkabi in the consule , i would like to if is working and request more data like size of shoes.. color of shoes.. but i didnt get it why that if is not working..thank you in advance
package denemeleredo; import java.util.Scanner; public class Ayakkabisecimi { public static void main(String[] args) { // TODO Auto-generated method stub Scanner cesit = new Scanner(System.in); System.out.println("Lutfen istediginiz ayakkabiyi giriniz. askerayakkabi,Babet,Iskarpin"); String ayakkabituru = cesit.nextLine(); System.out.println(ayakkabituru); if (ayakkabituru == "askerayakkabi") { askerayakkabi secilen = new askerayakkabi(); System.out.println("Lutfen istediginiz rengi yaziniz."); String taleprenk = cesit.nextLine(); System.out.println("Lutfen talep edilen olcuyu giriniz"); int talepolcu = cesit.nextInt(); System.out.println("Talep ettiginiz ayakkabi " + ayakkabituru + " istediginiz renk "+ taleprenk + " ve olcusu " + talepolcu); } } }