title: How to check the element of list string variable
body: <p>I wanted to write a simple system via the list, that will recognize symbols and do a bit of calculation of some symbols inside the list, and will tell if there are any of mistakes. </p>
  
  <p>And it looks like this:</p>
  
  <pre><code>private static List&lt;String&gt; list = new ArrayList&lt;&gt;();
  private static void splitToList(String string){
  
      list.addAll(Arrays.asList("((35+6-(4+4))=0;".split("")));
      chekList(list);
  }
  private static void chekList (List list){
      int open = 0;
      int close =0;
  
      for (int i=0;i&lt;list.size();i++) {
         System.out.println(list.get(i));
          if (list.get(i) == "(") {
              open++;
              System.out.println(open);
          }
          if (list.get(i) == ")") {
              close++;
              System.out.println(close);
          }
  
      }
      if (open != close){
          System.out.println("false!");
          br = true;
      }
  
  }
  </code></pre>
  
  <p>So the problem that this if statements for recognize "(" and ")" in list element does not work anyhow. Is there is any way to check my list element for being "(" or ")"?</p>
  
  <p>Here is a full IDE output. Without any of "open" and "close" results. </p>
  
  <p><a href="https://i.stack.imgur.com/wkO3a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wkO3a.png" alt="Here is a full IDE output"></a></p>