In the Fixed Size Array implementation of a Bag, depicted below as ArrayBag1,  what happens when a client tries to add an element to the ArrayBag1 but the underlying array is full?

A UML diagram of the BagInterface and ArrayBag class in Java. The BagInterface diagram lists method signatures including getCurrentSize(), isEmpty(), add(T), remove(), remove(T), clear(), getFrequencyOf(T), contains(T), and toArray(T[]). The ArrayBag class diagram shows it implements BagInterface and includes private fields: an array of type T named ‘bag’ and an integer ‘numberOfEntries’. It also lists methods such as ArrayBag(), ArrayBag(int), add(T), toArray(T[]), isArrayFull(), isEmpty(), getCurrentSize(), remove(), remove(T), clear(), getFrequencyOf(T), and contains(T).
The element does not get added
  • The add method replaces the last element with the new element
  • The add method doubles its size and adds the new element
  • The add method throws an exception

There are no hints for this question