Press "Enter" to skip to content

Posts tagged as “m2w3”

Comparing Objects in Java – “==”, “equals()”, “compareTo()” and “compare()

Java has a few different ways of comparing variables and objects with one another. “==”, “equals()”, “compareTo()” and “compare()”. Java provides various operators such as ‘==’ and ‘!=’ which check for equality and inequality respectively. They are used in a programming flow to check if certain criteria match or are…