I came across a class using Integer variables to capture size to be used in a for loop. Is this good practice or should we use the int primitive data type?
I
There can be a performance penalty due to boxing and unboxing, as you incur the overhead of converting between a primitive and a reference type.
However, the Integer class adds additional methods that can be very useful.