I want to compare two Long objects values using if conditions. When these values are less than 128, the if condit
if
num1 and num2 are Long objects. You should be using equals() to compare them. == comparison might work sometimes because of the way JVM boxes primitives, but don't depend on it.
num1
num2
equals()
==
if (num1.equals(num1)) { //code }