Level 11

Hi guys, please help me understand why below comes out with ‘true’?

public class EqualityOperators {
	public static void main(String[] args) {
boolean first = 2>5;
  boolean second = 6<7;
		System.out.println(first = second);


i think i found :blush:

I’m glad you debugged your program yourself, which is an essential part of learning to code. However, since this a forum post, it might be good to post the answer to the actual question in case someone else should come wandering here searching for an answer.

The answer, is that first=second is an assignment operation. So, boolean first is assigned the value of second, which is true. And then this value - true - gets printed as well in System.out.println(first = second);