Equality operators do not require that operands share the same ordering. For example, you can test equality across boolean, char, or int data types. The example below combines assigning variables and using an equality operator:
char myChar = ‘A’;
int myInt = -2;
System.out.println(myChar == myInt);
The example above will print out false because the value of myChar (‘A’) is not the same value as myInt (’-2’).
- Use any equality operator to directly compare two Boolean values. Do not declare any variables.
I’m not sure what to do. How do I compare two boolean values without using any variables?