私はJavaを使い慣れていませんが、私は以下のコードで迷っています。場合にはJavaのif-elseブロックでの等価比較の方法は?
boolean Smart;
boolean Flat;
int smallsmart = 322;
int largesmart = 405;
void price(){
Scanner in = new Scanner(System.in);
System.out.printf("%nWhat Type of TV would you like Smart of Flat ??? ");//Prompts
boolean TV = in.next() != null;
System.out.println("What Size would you like 32 or 42 inch ?? ");//Prompts
int Size = in.nextInt();
if (TV = Smart && Size == 32){//start of if
System.out.println("The Price of your Tv is " + smallsmart);
} else if (TV = Smart & Size == 42){//start of if
System.out.println("The Price of your Tv is " + largesmart);
}
'in.next()!= null'は常にtrueです。 – molbdnilo
ようこそスタックオーバーフロー!デバッガの使い方を学ぶ必要があるようです。 [補完的なデバッグ手法](https://ericlippert.com/2014/03/05/how-to-debug-small-programs/)にご協力ください。その後も問題が残っている場合は、もう少し詳しくお聞かせください。 –
'TV = Smart'は比較ではなく割り当てです –