Hi all,
I am trying to declare a Map object with an abstract superclass (TableFields_v2 ) object as follows:-
When I come to create the object element for the Map I want to be able to use a subclass of the superclass for the object; for example:-
Where TableFields_v2_ Year is a subclass of TableFields_v2
However, Java won't let me do it this way! Can anyone help, or offer a suggestion?
Regards, Mark
I am trying to declare a Map object with an abstract superclass (TableFields_v2 ) object as follows:-
Code:
private Map<Integer, TableFields_v2> elementList;
Code:
this.elementList = new HashMap<Integer, TableFields_v2_Year>();
However, Java won't let me do it this way! Can anyone help, or offer a suggestion?
Regards, Mark
Comment