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 我得到如下:爪哇 - 無法找到象徵Contstructor
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
我也弄不清是怎麼回事錯了,我的方法是不與文件名稱不匹配。在這種情況下,「Grammer」是正確的。
任何幫助?
請提供'GrammerStructure'的代碼。 –
請分享您的'GrammerStructure'類構造函數。 –