while( i <= j && i >= j && i != j) {}
how to declare i and j to make it be an infinite loop ?
// it’s an interview question I met.
it’s asking what’s the declarations of i and j, make it be always true.
And I cant make it out by declaring i and j as number types. What other types can meet it ?
iandjwill be automatically unboxed to ints for<=and>=, but not for!=.iandjare different instances, but have the same int value. That’s why all three comparisons will return true.