1.

How can we remove an object from ArrayList?(a) remove() method(b) using Iterator(c) remove() method and using Iterator(d) delete() methodThis question was addressed to me in homework.This intriguing question comes from Data Structures-List topic in portion java.util – The Collections Framework of Java

Answer»

The CORRECT option is (c) remove() method and using Iterator

The BEST explanation: There are 2 ways to remove an object from ARRAYLIST. We can use overloaded method remove(int INDEX) or remove(Object obj). We can also use an Iterator to remove the object.



Discussion

No Comment Found

Related InterviewSolutions