This question already has an answer here:
I'll get straight to the point. In the first if-statement I get an error regarding the types. I have commented below on where the issue occurs. How can I fix this?
public class Tutorial3 {
public static void main(String[] args) {
int a = 50;
int b = 50;
int c = 50;
if (b == a == c){ //This if statement says "incomparable types boolean and int"
System.out.println("This is a Equilateral Triangle");
}
else if (c == a || c == b || b == a ) {
System.out.println("This is a Isosceles Triangle");
}
else if (c != a || c != b || b != a) {
System.out.println("This is a Scalene Triangle");
}
}
}
Aucun commentaire:
Enregistrer un commentaire