Read a Constant From an Interface
easyQuestion 527A field declared in an interface is a constant: it is public static final even though none of those words are written. A class that implements the interface can use the constant by its plain name. CartRules holds the limit MAX_ITEMS. Complete canAdd() and the guard inside add() in Cart.
Requirements:
1. canAdd() returns true while count is less than MAX_ITEMS, and false once the cart is full.
2. add() returns false and leaves count alone when canAdd() is false. Otherwise it raises count by one and returns true (those two lines are written).
3. Use the constant MAX_ITEMS, not the number 3, so the cart follows the interface if the limit ever changes.
4. Do not change CartRules.
Do NOT write a main method.
Expected output
true true true true false false 3
= newline. The output ends with a newline, so print one after the last line.
Your output
Run your code to see the output here...