Use a stack to check .txt file for ('s, {'s, ['s, etc - Java
问题 I am trying to write a method in java to search a text file that I imported for specific characters. The file is actually a java program that I designed and converted to a .txt file. When an opening brace/bracket is found, I am supposed to add (push) it to a stack and then when a corresponding closing brace/bracket is found I am supposed to remove (pop) it from the stack. The purpose is to see if I have the correct amount of ) , } , ] and > to correspond with the ( , { , [ and > . If they all