Follow these steps to implement the example:
- Create the Event class. This class only stores information about the events our program will work with. Declare two private attributes: one called the date of the java.util.Date type and the other called the event of the String type. Generate the methods to write and read their values.
- Create the WriterTask class and specify that it implements the Runnable interface:
public class WriterTask implements Runnable {
- Declare the queue that stores the events and implement the constructor of the class that initializes this queue:
private Deque<Event> deque; public WriterTask (Deque<Event> deque){ this.deque=deque; }
- Implement the run() method of this task. This method will ...