能帮我解决下这个bug吗
IDE 提示: error: class PriorityQApp is public, should be declared in a file named PriorityQApp.java public class PriorityQApp {
可是我已经写了 public 了啊
////////////////////////////////////////////////////////////////
class Link {
public long dData; // data item
public Link next; // next link in list
// -------------------------
public Link(long dd) // constructor
{
dData = dd;
}
// -------------------------
public void displayLink() // display this link
{
System.out.print(dData + " ");
}
} // end class Link
// //////////////////////////////////////////////////////////////
class SortedList {
private Link first; // ref to first item
// -------------------------
public SortedList() // constructor
{
first = null;
}
// -------------------------
public boolean isEmpty() // true if no links
{
return (first == null);
}
// -------------------------
public void insert(long key) // insert, in order
{
Link newLink = new Link(key); // make new link
Link previous = null; // start at first
Link current = first;
// until end of list,
while (current != null && key > current.dData) { // or key > current,
previous = current;
current = current.next; // go to next item
}