Question: Using the following class, use a reference - based Queue and do the following operations: 1 . Add 5 0 to the Queue

Using the following class, use a reference-based Queue and do the following operations:
1. Add "50" to the Queue
2. Remove a node from the Queue
3. Add "10" to the Queue
public class PrintNode {
private String job;
private PrintNode link;
public PrintNode ()
{
job = null;
link = null;
}
public PrintNode (String job)
{
this.job = job;
link = null;
}
public PrintNode(String data, PrintNode link)
{
this.job = data;
this.link = link;
}
public void setLink(PrintNode newLink){
link = newLink;
}
public void setData(String newData){
job = newData;
}
public PrintNode getLink(){
return link;
}
public String getData(){
return job;
}
}

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!