Question: Java Programming: There is a list of customers ID and their products as below: Customer ID Product 1000 p1 1000 p2 1020 p2 1000 p3
Java Programming:
There is a list of customers ID and their products as below:
| Customer ID | Product |
| 1000 | p1 |
| 1000 | p2 |
| 1020 | p2 |
| 1000 | p3 |
| 1050 | p4 |
.
There is no order in the list.
Prepare a program that read the data of the list and print the customerID and all his products.
Hint: A HashMap from an Integer (Customer ID) to an ArrayList (type String) should be used.
For the stopping insert data the customerId should be -1.
The result should be:
Customer: 1000 p1 p2 p3 Customer: 1050 p4 Customer: 1020 p2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
