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 boolean equallists mmmmmmmmm (ArrayList mmmmmmm ArrayList list3) mmmmmmmm Example: list1: 4 13 1 list2: 4 2 1 list3: 1 0 1 0 (generated by the method) 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 3- Object of type ArrayList list2. 4- Add the following data to list2 (42 5- Object of type ArrayList list3. 6- Test the equallists method to print the result. 8 12 listl, ArrayList 1 9 0 list2, 9 0 1 2 0 5 0 1 0 18 19 0 1). 1 12 9 2 05).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
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
mmmmmmmmm
(ArrayList<E>
unnammmmm
ArrayList<E> list3)
mmmmmmmmmmm
Example:
list1: 4 13 1
8
list2: 4
2 1
12
list3: 1
0
1
0
(generated by the method)
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
3- Object of type ArrayList list2.
4- Add the following data to list2 (4
5- Object of type ArrayList list3.
6- Test the equallists method to print the result.
1
9
0
9
0 1
2 05
0
10
2
list2,
18 1 901).
1 12 9
2
0 5).
Transcribed Image Text: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 mmmmmmmmm (ArrayList<E> unnammmmm ArrayList<E> list3) mmmmmmmmmmm Example: list1: 4 13 1 8 list2: 4 2 1 12 list3: 1 0 1 0 (generated by the method) 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 3- Object of type ArrayList list2. 4- Add the following data to list2 (4 5- Object of type ArrayList list3. 6- Test the equallists method to print the result. 1 9 0 9 0 1 2 05 0 10 2 list2, 18 1 901). 1 12 9 2 0 5).
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education