Question: In a package called bag, create a class called MyBag that implements the Bag interface: public interface Bag extends Iterable { public boolean isEmpty(); public
In a package called bag, create a class called MyBag that implements the Bag interface:
public interface Bagextends Iterable { public boolean isEmpty(); public int size(); public void add(T item);
-} - Your MyBag implementation should use the Java ArrayList as its underlying data structure.
Any change made to the Bag interface or using a data structure/implementation other than
an ArrayList will result in a grade of 0. If you have any questions, ask!
Create a new class called BagHand in the cards package from the Activity which implements
the HandOfCards interface using your MyBag class. The BagHand class should contain a method called getValue() that returns the value of the hand using Blackjack rules (you can assume the value of an Ace is always 11).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
