Part 1 Write A Method Called Equallists In A Class Called Compare The Method Accepts Three Arraylist Objects List1 L 1 (51.73 KiB) Viewed 62 times
Part 1 Write A Method Called Equallists In A Class Called Compare The Method Accepts Three Arraylist Objects List1 L 2 (12.51 KiB) Viewed 62 times
Part #1: Write a method called equallists in a class called compare. The method accepts three ArrayList objects list1, list2 and list3 of type ArrayList as parameters. The list3 is to be generated by compare the list1 and list2 by the method, if both lists list1 items and list2 items are equal then write 1 in the same index in list3, else write 0. public class compare { public static<E> boolean equallists (ArrayList<E> ArrayList<E> list3) { listl, ArrayList<E> } Part # 2: Write a class called Test_equallists having main method to test the application. In main method create following: 1- Object of type ArrayList list1. 2- Add the following data to list1 (4 13 0 1). list2, 3- Object of type ArrayList list2. 4- Add the following data to list2 (4 5). 0 1 8 1 9 1 12 9 2
0 5). 5- Object of type ArrayList list3. 6- Test the equallists method to print the result. Example: list1: list2: list3: 4 13 42 10 8 1 12 1 0 (generated by the method) 1 1 9 0 9 0 1 2 0 0 1 0 5
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!