[Solved]-Question 3 20 Points Implement Class Named Myarraylist Extends Javautilarraylist Overridin Q37277264
I am not sure about this one![Question 3: [20 points] Implement a class named MyArrayList that extends the java.util.ArrayList by overriding the add method](https://media.cheggcdn.com/media%2F460%2F46024c67-1b11-4939-befe-145ca7d1b431%2Fimage.png)
Question 3: [20 points] Implement a class named MyArrayList that extends the java.util.ArrayList by overriding the add method in the following way: it does nothing if the object to be added already exists in the collection; otherwise it calls the add method in the super class to add the object into the collection. Use o1.equals(o2) to test if two objects o1 and o2 are equal. ow Help “Hexagonjava DArrayListjava DDuplicatejava DelominateDup-DG 1 import java.util.ArrayList; 2 public class MyArrayListf String o1; 5 static String o2; 6 public boolean equals (Object obj) f 7 if (o1.equals (o2)) ( 8 9 3 10 11 y 12 public static void main(String[] args) f 13 14 15 16 17 18 private void add(String b2) return false; return true; MyArrayList myList-new MyArrayList); myList.add(o2); // TODO Auto-generated method stub // TODO Auto-generated method stub 219 20 21 23 24 25 Problems e Javadoc ke. Declaration-Console X No consoles to display at this time. Show transcribed image text Question 3: [20 points] Implement a class named MyArrayList that extends the java.util.ArrayList by overriding the add method in the following way: it does nothing if the object to be added already exists in the collection; otherwise it calls the add method in the super class to add the object into the collection. Use o1.equals(o2) to test if two objects o1 and o2 are equal.
ow Help “Hexagonjava DArrayListjava DDuplicatejava DelominateDup-DG 1 import java.util.ArrayList; 2 public class MyArrayListf String o1; 5 static String o2; 6 public boolean equals (Object obj) f 7 if (o1.equals (o2)) ( 8 9 3 10 11 y 12 public static void main(String[] args) f 13 14 15 16 17 18 private void add(String b2) return false; return true; MyArrayList myList-new MyArrayList); myList.add(o2); // TODO Auto-generated method stub // TODO Auto-generated method stub 219 20 21 23 24 25 Problems e Javadoc ke. Declaration-Console X No consoles to display at this time.
Expert Answer
Answer to Question 3: [20 points] Implement a class named MyArrayList that extends the java.util.ArrayList by overriding the add m… . . .
OR

