Public static void swap (Pair<?> P) {
SwapHelper (p);
}
Public static & lt; T> Void swapHelper (PairP) {
T T=p.g etFirst ();
P. etFirst (p.g etSecond ());
P. etSecond (t);
}
P - 335, said the inevitable
A public static void maxminBonus (Manager [], Pair<? Super Manager> Resu1t) {
MaxminBonus (a, result);
PairAlg. Swap (result);//OK - swapHelper captures wildcard type
}
Turning the program list becomes
A public static void maxminBonus (Manager [], Pair<? Super Manager> Resu1t) {
MaxminBonus (a, result);
PairAlg. SwapHelper (result);//OK - swapHelper captures wildcard type
}