I used random generator to generate four numbers, then I have to decide if three of them are the same.
What is wrong with the following code ?
if((r1= r2 =r3)|| (r1 = r2 = r4)|| (r1 = r3 =r4)|| (r2 = r3 =r4)) {
System.out.println("Three of a kind.");
}
The error says cannot convert from int
to boolean
. Also, I thought it should be ==
, but ==
yields error while =
doesn't.