For making generic methods, we can use Integer, but not int. What is the reason behind this concept?
Why not int used in generic
It doesn’t really make any difference in this case. Java uses a technique called ‘Autoboxing’ i.e it wraps or unwraps primitive data types into reference types according to its need. In fact, INTEGER here is used because later ahead, Ma’am uses the String array (which is a reference data type) so, just to make comparisons easier she passes an INTEGER reference array.