public interface StringStackInterface {
//Private fields needed:
// int size (also keeps the current position)
// String [] elementData
private int size;
public void push(String s);
public String pop();
public String peek();
public int length();
public boolean isEmpty();
@Override
public String toString();
public boolean isEqual(StringStackInterface stack);
}
为什么 private int size; 这段会报错
------解决思路----------------------
既然是final public static则必须初始化
比如:
int size = 1;
String [] elementData={“1”,“2”};
记得好像不用写final public static,你写不写都是强制为这样的属性