【发布时间】:2009-12-28 23:33:05
【问题描述】:
我有:
/*
* File: NameSurferEntry.java
* --------------------------
* This class represents a single entry in the database. Each
* NameSurferEntry contains a name and a list giving the popularity
* of that name for each decade stretching back to 1900.
*/
import acm.util.*;
import java.util.*;
public class NameSurferEntry implements NameSurferConstants {
/* Constructor: NameSurferEntry(line) */
/**
* Creates a new NameSurferEntry from a data line as it appears
* in the data file. Each line begins with the name, which is
* followed by integers giving the rank of that name for each
* decade.
*/
public NameSurferEntry(String line) {
findName(line);
findDecades(line);
}
...
作为一个班级。
如何从另一个类中调用方法 NameSurferEntry。
【问题讨论】:
-
嗯,感谢您适当地标记问题,但下次使用更具描述性的标题;)
-
此外,您还希望调用类与 NameSurferEntry 类位于同一文件夹中。