The following is a Java class of simplified shopping cart, whichhas a number of
attributes and methods.
public class shoppingCart {
private String customerName;
private String customerAssress;
private String contactNumber;
……
private List<String> cartItems = newArrayList<String>();
……
public String addItem (String str) {
if (!cartItems.contains(str)) {
cartItems.add(str);
return new String(“The item has been added”);
} else return new String(“The item already existed”); }
public String removeItem(String str) {
if (cartItems.contains(str)) {
cartItems.remove(str);
return new String(“The item has been removed”);
} else return new String(“The item does not exist”);
}
……
}
(a) What is the term in Java EE to describe an instance of theshoppingCart class?
(1 mark)
(b) Assume that the shoppingCart object needs to be made into anEJB, which can
be called remotely
PayPal Gateway not configured
PayPal Gateway not configured