11. Equality Operators


#1

Instructions:
Use any equality operator to directly compare two Boolean values. Do not declare any variables.

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

boolean coolName = true;
boolean sick = true;
	System.out.println(coolName == sick);

}

}

And yess, it is right. However, I do not understand what the instruction really means by “Do not declare any variables.”. I think I already declared variables as coolName and sick and yet, it works. Well, I don’t get the question.


#2

The lessons means not to declare any additional variables.


#3

What is equality operator


#4

Equality, Relational, and Conditional Operators


#5

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