做一个空栈,读入字符直到结尾.如果读入一个封闭符号,空栈时报错;非空时弹出栈尾字符,如果不匹配则报错.否则读入为开放字符,压入栈中.最后如果栈空,返回true. 其中用到MyStack类,详情请见 public class KuohaoJiancha { private char [] item = {'(',')','[',']','{','}'}; private MyStack stack = new MyStack(); private char[] str; private int c…