11. Equality Operators


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.


The lessons means not to declare any additional variables.


What is equality operator


Equality, Relational, and Conditional Operators


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