# Compares values for equality# For example, check if two numbers or strings are the samea == b# Compares identity# Whether two variables point to the same object in memorya is b
SQL
-- Compares a value or column to another value.-- If either side of the comparison is `NULL`, the result is `NULL` (not `TRUE`).SELECT *FROM employees WHERE salary = 5000;-- Checks for `NULL` or `NOT NULL` values explicitly.SELECT * FROM employees WHERE bonus IS NULL;
Defining Custom Comparison Logic
Java
class Node implements Comparable<Node> { public int freq; @Override public int compareTo(Node other) { return Integer.compare(other.freq, this.freq); }}
The comparator logic above implements a descending order. To achieve ascending order, swap other.freq and this.freq