質問は私のif文についてです。すべて同じ型の 3 つの値を比較していますが、「引数の型 == は boolean,int 型では定義されていません」というようなエラーが発生します && を使用して値を個別に比較するようにコードを変更すると、 .. 値 == 値 1 && 値 = 値 2 なので、エラーは発生しません。違いはなんですか?
Card[] cardsIn = cards;
boolean threeOfAKindEval = false;
//the for loops runs through every possible combination of the 5 card array. It starts at
//0,0,0 and ends at 5,5,5/ Inside the last for loop, I check for a three of a kind
//My if statement also checks to make sure I am not comparing the same card with
//itself three times
for(int index = 0; index < cards.length; index++){
for(int indexCheck = 0; indexCheck < cards.length;indexCheck++){
for(int indexCheckThree = 0; indexCheckThree < cards.length;
indexCheckThree++){
if(cardsIn[index].getValue() == cardsIn[indexCheck].getValue() == cardsIn[indexCheckThree].getValue())
threeOfAKindEval = true;
}
}
}