This is a java question queue instance 1 JavautilQueue ql

This is a java question, //queue instance # 1 Java.util.Queue ql = new Java.util.Queue();//queue instance # 2 Java.util.LinkedList q2 = new Java.util.LinkedList();//queue instance # 3 Java.util.Queue q3 = new Java.util.LinkedList(); Please comment on the code above, using AT MOST 3degree words.

Solution

1)

-->It is a generic queue.
-->Queue is a interface which extends collection interface
-->Customer is user-defined class
-->q1 is instance of Queue of type Customer(Customer is type of object like string ,int etc....)


------------------------------------------------------------------------------------------------

2)

-->It is a generic queue of type Customer.
-->Customer is user-defined class
-->Linkedlist is a class which extends the AbstractList class and implements List and Deque interfaces.
-->q2 is instance to LinkedList of type Customer


----------------------------------------------------------------------------------------------------------

3)

-->It is a generic queue.
-->as Linkedlist implements List and Deque(which extends Queue) Queue is super class for Linkedlist
-->Here q3 is reference variable type of Queue which holds Linkedlist objec;

 This is a java question, //queue instance # 1 Java.util.Queue ql = new Java.util.Queue();//queue instance # 2 Java.util.LinkedList q2 = new Java.util.LinkedLis

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site