title: How to check this If Condition? - Java
body: <p>I have variable number of input values. 
  Like input is an array with variable values like [6,23,6] or [8,3,97].. like that and also i need to check it against another array.
  Hence, I form a condition like this,</p>
  
  <pre><code>StringBuilder formStmt= new StringBuilder("");
  for (int i = 0; i &lt; input.size(); i++) {
  
                  formStmt= formStmt.append("input[" + i + "] != anotherArray[" +i+ "] &amp;&amp;");
              }
              formStmt= formStmt.delete(formStmt.length()-2, formStmt.length());
  </code></pre>
  
  <p>How to check <strong>formStmt</strong> inside if?</p>
  
  <p>The Thing is I'm forming the if statement using formStmt. I'm forming </p>
  
  <pre><code>formStmt = input[0] !=anotherArray[i] &amp;&amp; input[1] != anotherArray[i]
  </code></pre>
  
  <p>and placing it inside if.. like</p>
  
  <pre><code>if (formStmt){
  </code></pre>
  
  <p>//code
  }</p>
  
  <p>Edit:
  I have updated the question. The right side value also is an array. Thats why I go for a stmt like this.?</p>