-
i <= j
is evaluated totrue
, because auto unboxing happens for int
comparisons and then bothi
andj
hold the default value,0
. -
j <= i
is evaluated totrue
because of the above reason. -
i != j
is evaluated totrue
, because bothi
andj
are
different objects. And while comparing objects, there isn’t any need of
auto unboxing.
All the conditions are true, and you are not changing i
and j
in loop, so it is running infinitely.