package query public class LinkQuery { private Node front private Node vear public LinkQuery() { this.front=null this.vear=null } public void add(int i) { Node newNode=new Node(i) if(vear==null && front==null) { vear=newNode front=newNode return } vear.next=newNode vear=newNode } public int remove() { if(this.front==null) { System.out.println("队是空的,无法取") return -1 } int temp=this.front.data this.front=this.front.next if(this.front==null) { this.vear=null }