Multiple Choice
You have created a ShoppingCart class and a Fruit class. Which of the following will correctly declare an array list of Fruit objects in the ShoppingCart class?
A) public ShoppingCart
{
Private Fruit ArrayList fruits;
}
B) public ShoppingCart
{
Private ArrayList fruits;
}
C) public ShoppingCart
{
Private ArrayList<Fruit> fruits;
}
D) public ShoppingCart
{
Public ArrayList<Fruit> fruits;
}
Correct Answer:

Verified
Correct Answer:
Verified
Q56: Insert the missing code in the following
Q57: Which of the following statements about objects
Q58: You are creating a class named Employee.
Q59: Consider the following code snippet:<br>Public class Coin<br>{<br>Private
Q60: Insert the missing code in the following
Q62: Which of the following statements about a
Q63: Consider the following code snippet:<br>Public class Vehicle<br>{<br>Private
Q64: Which of the following declares a rpmRating
Q65: Which of the following is NOT part
Q66: Which of the following statements using data