I have the following classes:
public class CollectionCustomClass extends ArrayList<CustomClass>
public abstract class CustomClass
public class SubClass1 extends CustomClass
public class SubClass2 extends CustomClass
and in a method i want to do the following:
CollectionCustomClass ccc = new CollectionCustomClass();
ccc.add(new SubClass1())
ccc.add(new SubClass2())
ccc.add(new SubClass1())
ccc.add(new SubClass2())
ccc.find(SubClass1)
The result would be the 2 Subclass1.
How can i achieve this?
Try
and