import java.util.*; public class OurStackExample2 { public static void main (String[] argv) { String s = "((()))"; checkParens (s); s = "()(())()"; checkParens (s); s = "((())"; checkParens (s); } static void checkParens (String inputStr) { // Extract the letters from the String into a char array. char[] letters = inputStr.toCharArray(); // Create an instance of the stack. OurStack2 stack = new OurStack2 (); boolean unbalanced = false; for (int i=0; i