Question: WHY WONT IT COMPILE HELP //*********************************************************** // TestQueue // A driver to test the methods of the QueueADT implementations. //********************************************************** public class TestQueue { public

WHY WONT IT COMPILE HELP //*********************************************************** // TestQueue // A driver to test the methods of the QueueADT implementations. //********************************************************** public class TestQueue { public static void main(String[] args) { QueueADT q = new ArrayQueue(); try { System.out.println(" Enqueuing chocolate, cake, pie, truffles:"); q.enqueue("chocolate"); q.enqueue("cake"); q.enqueue("pie"); q.enqueue("truffles"); System.out.println(" Here's the queue: " + q); System.out.println("It contains " + q.size() + " items."); System.out.println(" Dequeuing two..."); System.out.println(q.dequeue()); System.out.println(q.dequeue()); System.out .println(" Enqueuing cookies, profiteroles, mousse, cheesecake, ice cream:"); q.enqueue("cookies"); q.enqueue("profiteroles"); q.enqueue("mousse"); q.enqueue("cheesecake"); q.enqueue("ice cream"); System.out.println(" Here's the queue again: " + q); System.out.println("Nowitcontains" + q.size() + " items."); System.out.println(" Dequeuing everything in queue"); while (!q.isEmpty()) System.out.println(q.dequeue()); System.out.println(" Nowitcontains" + q.size() + "items."); if (q.isEmpty()) System.out.println("Queue is empty!"); else System.out.println("Queue is not empty -- why not??!!"); } catch (Exception e) { e.printStackTrace(); } } }

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!