You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using valueOf is approximately 3.5 times faster than using constructor
Because Using new Integer(int) is guaranteed to always result in a new object whereas Integer.valueOf(int) allows caching of values to be done by the compiler, class library, or JVM.
So changed source like this
return (new Integer(c1pl)).compareTo(c2pl) * -1;
==>return (Integer.valueOf(c1pl)).compareTo(c2pl) * -1;