import java.lang.*;
public class GrammerStack extends GrammerStructure implements StringStack {
private String structName;
private int cap;
public GrammerStack(String structureName, int limit){
this.structName = structureName;
this.cap = limit;
System.out.println(structName+"["+cap+"]");
}
public void GrammerStructure(String structureName){
this.structName = structureName;
}
//Empty overrides.
public String[] asArray(){};
public String push(String item) throws FillException{};
public String pop() throws EmptyException{};
public boolean contains(String query){};
public void empty(){};
public double fillPercent(){};
public String getName(){ return structName; }
public void main(String args[]){
GrammerStack("Stack1",3);
}
}
当我运行时: javac GrammerStack.java 我得到以下信息:
GrammerStack.java:15: cannot find symbol
symbol : constructor GrammerStructure()
location: class GrammerStructure
public GrammerStack(String structureName, int limit){
^
GrammerStack.java:41: cannot find symbol
symbol : method GrammerStack(java.lang.String,int)
location: class GrammerStack
GrammerStack("Stack1",3);
^
2 errors
我无法弄清楚这里出了什么问题,我的方法也与文件名不匹配。在这种情况下,“语法”是正确的。
有什么帮助吗?