JAVA DATA STRUCTURE (Linked Lists/Queue)
public class Node {
  int value;
  Node nextNode;
  Node(int v, Node n){
     value = v;
     nextNode = n;
  }
  Node (int v){
     this(v,null);
  }
}
public class Stack {
  protected Node top;
  Stack(){
     top = null;
  }
  boolean isEmpty(){
     return( top == null);
  }
  void push(int v){
     Node tempPointer;
     tempPointer = new Node(v);
     tempPointer.nextNode = top;
     top = tempPointer;
  }
  int pop(){
     int tempValue;
     tempValue = top.value;
     top = top.nextNode;
     return tempValue;
  }
  void printStack(){
     Node aPointer = top;
     String tempString = \"\";
     while (aPointer != null)
     {
        tempString =tempString + aPointer.value + \"\n\";
        aPointer =aPointer.nextNode;
     }
     System.out.println(tempString);
  }
}
public class StackWithLinkedList {
  public static void main(String[] args){
     int popValue;
     Stack myStack = new Stack();
     myStack.push(5);
     myStack.push(7);
     myStack.push(9);
     myStack.printStack();
     popValue = myStack.pop();
     popValue = myStack.pop();
     myStack.printStack();
  }
}
Add the Queue class to the program introduced above. NewClass should be CREATED (-->NOT importing<-- ANY TYPE ofCLASS from Java Library, just using the provided classes), Youshould create Queue class like we created the Stack class(see theCODE above). Create the Queue class with the followingspecifications:
a. It must create a queue(constructor)
b. Insert one end (enqueue)
c. Do extractions at the other end(dequeue)
d. Determine if queue is empty (isEmpty)
e. Print the content of the queue (printQueue)
f. Finally, you must develop a main class QueueWithLinkedList thatproves that every method works (just like we did with theStackWithLinkedList class provided in the programabove)