I have three classes. Class `A` (an abstract class) is the parent for both class `B` and class `C`.

I need to have a container that can hold objects of either `B` or `C` at the same time.

I tried to do this

```
ArrayList<A> myCollection = new ArrayList<A>();

```

and then

```
myCollection.add(b); //b is an instance of class B

```

I get this error:

> 
> The method add(A) in the type ArrayList is not applicable for the arguments (B)
> 
> 
> 

Is there a way that I can store objects of both class `B` and `C` in my `ArrayList`? Or is there another data structure that I can use?