EqualityOperators.java:6: error: incomparable types: boolean and char
System.out.println(myFact == myChar);
Why isn’t this code working? Apparently in the print statement I can only set a character and an integer data type equal to each other, this code with boolean and char data type won’t work or boolean and int doesn’t work as well can someone explain to me why?
public class EqualityOperators {
public static void main(String[] args) {
boolean myFact = false;
char myChar = 'A';
System.out.println(myFact == myChar);
}
}