Does int vs long comparison hurt performance in Java?

Viewed 3261

Does comparing an int and long hurt performance? i.e.

int x = 1;
long y = 2;
if (x < y) doStuff();

as opposed to:

int x = 1;
int y = 2;
if (x < y) ...

Is there a conversion of types? or does the layout of bits in memory allow a straight comparison? (i.e. the extra bits in the long can all assumed to be 0 for an int)

3 Answers
Related