Question: 7.22 from A Crash Course in Java Turn the MessageQueue class of Chapter 3 into a generic class Queue import java.util.ArrayList; 2 3 /** 4
7.22 from A Crash Course in Java
Turn the MessageQueue class of Chapter 3 into a generic class Queue
import java.util.ArrayList; 2 3 /** 4 A first-in, first-out collection of messages. This 5 implementation is not very efficient. We will consider 6 a more efficient implementation in chapter 3. 7 */ 8 public class MessageQueue 9 { 10 /** 11 Constructs an empty message queue. 12 */ 13 public MessageQueue() 14 { Fall 2017 Students of Suneuy Kim
Below are files given to complete this question
TestGenericQueue.java
public class TestGenericQueue {
public static void main(String[] args) {
GenericQueue
GenericQueue
GenericQueue
GenericQueue
queue.add(1);
queue.add(2);
queue.add(3);
squeue.add("a");
squeue.add("b");
squeue.add("c");
System.out.println(queue);
System.out.println(squeue);
}
}
Output7.22.txt
[1 2 3]
[a b c]
A Crash Course in Java is the book this question is from
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
