What do I put to solve level 11 on lesson 1?


#1

I don't know, so if somebody who does know could tell me! BTW the question is to use any equality operator to directly compare two Boolean values. Do not declare any variables.


#2

Well let us take a look at it!

First, what is an equality operator? Well our lesson tells us this:

You may have noticed that the relational operators did not include 
an operator for testing "equals to". In Java, equality operators 
are used to test equality.

The equality operators are:

==: equal to.
!=: not equal to.
Equality operators do not require that operands share the same ordering.

So when using equality operators we either use == or !=. Now in this case the instructions are:

1.) Use any equality operator to directly compare two Boolean 
values. Do not declare any variables.

Now your starting code is this:

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

		System.out.println();

	}
}

We want to directly compare two booleans (true, false) in the system.out.println(); using one of our equality operators == or !=. Therefore we are going to have something like this:

System.out.println(boolean equality operator boolean); 
//this is just an example

#3

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