Need Help at "11. Equality Operators"


#1

Hello!
I'm stuck at "11. Equality Operators".
The instruction is "Use any equality operator to directly compare two Boolean values. Do not declare any variables"
The code is

public class RelationalOperators {
    public static void main(String[] args) {

        System.out.println( );

    }
}

I tried to enter "true != false", "1+3 = 4-1", ..., but that all didn't work. What is the solution to this excercise?


#2

@p00m4
Please read
https://docs.oracle.com/cd/B19306_01/olap.102/b14346/dml_datatypes004.htm#CJACGBGE
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/opsummary.html


#3

Hello!
I've read the links, and tried the following code:
...

public class EqualityOperators {
public static void main(String[] args) {

    System.out.println(true == true);


}

}

...
which should be correct, but I still get the error "Did you use a valid
equality operator? Refer to the example if you need help."


#4

Ok, I got it. Now, I tried "true == false" which was the right solution.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.