Question: use java mplement a Logger class that has the following methods: A default constructor creating an empty logger. int put(String element): put the element into

use java

mplement a Logger class that has the following methods:

  • A default constructor creating an empty logger.
  • int put(String element): put the element into the logger and record its sequence number. The sequence number should stay the same for the entry.
  • List get(String element): retrieve the sequence numbers for each occurrence of the string in the logger. The sequence for this logger starts at 1.
  • int size(): number of entries in the logger.
  • int reset(): resets the logger, empties the entries and sets the start sequence to 1. Returns the number of entries before the reset.

Try to come up with an interface definition LoggerInterface for this class and then implements your interface.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!