title: How to check if a String is balanced?
body: <p>I want to test if an input String is balanced. It would be balanced if there is a matching opening and closing parenthesis, bracket or brace.</p>
  
  <pre><code>example:
  {} balanced
  () balanced
  [] balanced
  If S is balanced so is (S)
  If S and T are balanced so is ST
  
  
  public static boolean isBalanced(String in)
  {
      Stack st = new Stack();
  
      for(char chr : in.toCharArray())
      {
          if(chr == '{')
              st.push(chr);
  
      }
  
      return false;
  }
  </code></pre>
  
  <p>I'm having problems choosing what to do. Should I put every opening or closing parenthesis, bracket, or brace in a stack then pop them out? If I pop them out, how does that really help me?</p>