title: Check char in an char array against a integer
body: <p>I have a character array that looks like this:</p>
  <p>[0, 1, 1, 0, 1, 0]</p>
  <p>I wanted to check if a index supplied by the user matches 1:</p>
  <pre><code>                System.out.println(&quot;Enter the file index you want&quot;);
                  int fileIndex = input.nextInt();
                  
                  System.out.println(&quot;File you are looking for is &quot; + myFile[fileIndex]);
  </code></pre>
  <p>When I enter 1 it returns File you are looking for is 1</p>
  <p>Which is what I want:</p>
  <p>But when the result is 1, I wanted to do something:</p>
  <pre><code>                if(myFile[fileIndex] == (char)1) {
                      //Do something because the char at this index is 1
                      System.out.println(&quot;HERE&quot;)
                  }
  </code></pre>
  <p>However, even when <code>myFile[fileIndex]</code> is 1 the if condition does not work. What is the right way to check a character against a integer?</p>