=
==
= assigns — it puts a value into a variable. == compares two values and produces true or false. Mixing them up is a classic bug.
true
false
x = 5; // assign: store 5 in x x == 5 // compare: is x equal to 5?
▶ Try it: run this, then change something and run it again.
Which line stores the value 5 in x?
x
True or false?
Sort each piece of code by what it does.
What does == do?
Type exactly what this program prints.
public class Main { public static void main(String[] a){ int x = 5; System.out.println(x == 5); }}