Compare Booloean without variables, so don't use numbers?


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

		System.out.println(BlahBlah == NahNah);



I'm a little confused on what you're asking. So you are trying to get a boolean value printed without using variables?


Yeah, it says use any equality operator to directly compare two booleans. What I got from that is put 2 things == to each other, but it's not working and that's where I'm lost.


Does something like this work?:
System.out.println(true==true); - to get true or,
System.out.println(false==true); - to get false?

What does it say when you try to submit your code? (Im guessing something along the lines of the variables being undefined?)


You have that right except that you can use other comparison operators besides == if you want. Not just any two things though, two Boolean values. There are only two Boolean values to choose from: true and false.


Thank you, I didn't realize true and false were the only things I could put!


I understand now true and false are the only understandable answers. thanks for clearing this up!


It can get a little confusing sometimes, essentially like @albionsrefuge said a boolean value is either true or false. A variable can be assigned a boolean value and used like this:
Boolean isActive = true;
-> Prints: True

or a comparison using comparison operators will return a boolean (==, != , <, >, ... etc.)
System.out.println(1==3); -> Prints: False
System.out.println(1!=3); -> Prints: True


you can use numerals to compare as boolean.
like this:-

System.out.println(1==3); -> Prints: False
System.out.println(1!=3); -> Prints: True

this will do for sure!