I have classes A, B, C and D where B extends A, C extends A and
A
B
C
D
You can create the array list of super class type. so you can do this.
ArrayList arrayList=new ArrayList();