Wildcard in Generics for Java

One thing interesting I learnt today is the scope of Wildcard Generics. Let say both CheckingAccount and SavingsAccount are extended (inherited) from Account: import com.mybank.domain.*; import java.util.*; public class TestCovariance { public static void printNames(List lea) { for (int i=0; i < lea.size(); i++) { System.out.println(lea.get(i).getName()); //lea only able to access methods from immediate parent […]