Hi, I am doing the self-test question #8 right now for chap 7, and I am confused with option A,
The question is:
Given a method declared as:
A programmer wants to use this method like this:
Will the code compile?
The answer tell me no but why? Why can't I return an arrayList? I tried it and looks like it worked OK. I should be able to return a concrete class obj and a subclass object if the return type specified is an interface type or super class type, can't I?