Question: This is for java 18) (8 points)Suppose you have created a shoppingcart class and a Fruit class: a) declare an instance variable fruits, that is

This is for java
 This is for java 18) (8 points)Suppose you have created a

18) (8 points)Suppose you have created a shoppingcart class and a Fruit class: a) declare an instance variable fruits, that is an array list of Frust objects in the Shoppingcart class. public ShoppingCart /l declares fruits as an array list of Fruit objects // write a default constructor that initialize the array list to be empty: // write an add method that add a given Fruit object to the array list t count the number of 19)(10 points) Write a static method (include the header and the body) tha "xx" in the given string, overlapping is allowed, so countXX("abexx") returns 1 countXX("xxx") returns 2 countXX("xxxx") returns 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!