case ']'case ')'if!thestack isempty(/if stack not char chx thestack pop()/pop and check if(ch=='}&chx!='{'|(ch==']&chx!='['|(ch==')&chx!='('system out println("error"+ch+at "+ )else /prematurely empty system out println("error"+ch+at "+ )breakdefault/no action on other characters break/end switch /end for /at this pointall characters have been processed if!thestack isempty(system out println("errormissing right delimiter")/end check(///end class bracketchecker ///////////////////////////////////////////////////////////////class bracketsapp public static void main(string[argsthrows ioexception string inputwhile(truesystem out print"enter string containing delimiters")system out flush()input getstring()/read string from kbd ifinput equals(""/quit if [enterbreak/make bracketchecker bracketchecker thechecker new bracketchecker(input)thechecker check()/check brackets /end while /end main(//public static string getstring(throws ioexception inputstreamreader isr new inputstreamreader(system in)