我有以下Subset.java
文件:
package week2;
import edu.princeton.cs.algs4.StdOut;
import edu.princeton.cs.algs4.StdIn;
public class Subset {
public static void main(String[] args) {
int k = Integer.parseInt(args[0]);
RandomizedQueue<String> randQueue = new RandomizedQueue<String>();
while (!StdIn.isEmpty()) {
randQueue.enqueue(StdIn.readString());
}
for (int i = 0; i < k; i++) {
StdOut.println(randQueue.dequeue());
}
}
}
同一文件夹中还有RandomizedQueue.java
。但是,当我在终端中运行javac-algs4 Subset.java
时,出现以下错误:
Subset.java:10: error: cannot find symbol
RandomizedQueue<String> randQueue = new RandomizedQueue<String>();
^
symbol: class RandomizedQueue
location: class Subset
Subset.java:10: error: cannot find symbol
RandomizedQueue<String> randQueue = new RandomizedQueue<String>();
^
symbol: class RandomizedQueue
location: class Subset
2 errors
(请原谅,我是Java的新手。)