I have an empty abstract base class:
public abstract class base{ }
and two class that extend it:
public class a extends base{}
public class b extends base{}
and in another class I am referencing it :
public class it {
List<base> list;
list = new ArrayList<a>;
//getting an error above.
// I thought I could do this?
}
What should I try? I was trying to have a list of the base class. Then based upon circumstance, be able to create a list of the two extending classes.
What if I wanted to do something like this: