how can I get acces to a field of an object in an ArrayList, when the object extends the type I wrote in the ArrayList generics ?
Heres the code:
ArrayList<ObjectA> objA = new ArrayList()<>;
objA.add( new ObjectA() );
objA.add( new ObjectAB() ); // ObjectAB extends ObjectA
now I would like to change the variablein ObjectAB, stored in the list
( only ObjectAB has this field, not ObjectA )
only ObjectAB has this field, not ObjectA?