Multiple choice

Which of the following methods is/are present in the ArrayList class in Java?

  1. sort(int[] a)

  2. indexOf(Object o)

  3. copyOfRange(double[] orr, int fr, int t)

  4. Both 1 and 2

  5. Both 2 and 3

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

indexOf(Object o) method is present in the ArrayList class in Java.