Question: Assume a Customer class has a constructor with a name parameter that initializes a name instance variable, and assume this class includes a getName method.
Assume a Customer class has a constructor with a name parameter that initializes a name instance variable, and assume this class includes a getName method. A driver for this class includes this code:

Add code that inserts into the customers list a new customer named “Peter”. Make the insertion immediately before the friend object.
LinkedList customers new Linked List (); Customer friend = new Customer("Pratima"); int index; = customers.add(new Customer("Pranoj")); customers.add(new Customer ("Rachel")); customers.add(friend); customers.add(new Customer("Mohammad")); customers.add(new Customer("Jasur")); customers.add(new Customer ("Shyan"));
Step by Step Solution
3.39 Rating (152 Votes )
There are 3 Steps involved in it
To insert a new customer named Peter immediately before the friend object in the customers list we w... View full answer
Get step-by-step solutions from verified subject matter experts
