Suppose there are few classes all extending an abstract class abc :-
public class mno extends abc { ... }
public class pqr extends abc { ... }
public class xyz extends abc { ... }
there is a list of objects which contains object of these class.
List<abc> f =new ArrayList<abc>();
f.add(new mno());
f.add(new pqr());
f.add(new xyz());
Is there a way to check if list f contains an object of class xyz and remove it from the list.
I tried f.contains(xyz.class) or f.contains(new xyz()) but it returned flase