1
오류는 다음과 같습니다. == 철회하지 않는 문자열. 둘 다 사용할 수 있기를 원합니다 (인출) & (보증금).코드가 올바른 문자열을 출력하지 않습니다.
오류는 다음과 같습니다. == 철회하지 않는 문자열. 둘 다 사용할 수 있기를 원합니다 (인출) & (보증금).코드가 올바른 문자열을 출력하지 않습니다.
import java.util.Scanner;
public class BasicClasses {
public static void main(String[] args) {
System.out.println("Welcome to First National Bank (FNB)");
Scanner Key = new Scanner(System.in);
String Question = Key.nextLine();
BasicClasses flix = new BasicClasses();
System.out.print(" | Withdraw | or | Deposit | [ ");
Scanner Key1 = new Scanner(System.in);
String Which = Key.nextLine();
if(Which == "withdraw") {
System.out.println("|Withdraw| - | How much do you Want to Withdraw?");
} else {
System.out.println("|Deposit| - | How much will you be Depositing?");
}
}
}는 다음과 같이 비교 : 이 if(Which.equals("withdraw"))
Thnx이 :) 완벽했다. –