is this possible? if not, why isn't this possible in Java?
interface B extends A {} public List<B> getList(); List<A> = getList(); // Type mismatch: cannot convert from List<B> to List<A>
public List getComments() throws RemoteException; public List getComments(int questionnaireId) throws RemoteException { return classLoader.getQuestionnaire(questionnaireId).getComments(); The compiler issues a Type mismatch: cannot convert from List to List Which I find perplexing as the compiler can assure that at the very least it is a List of Comment objects. Yes, however Java's generics work correctly to prevent you ...