title: charAt().equals() causes "char cannot be dereferenced"
body: <p>I am trying to check a string for hyphens at different positions (for a phone number because the input varies), but I keep getting the error </p>
  
  <blockquote>
    <p>char cannot be dereferenced</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>do {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      System.out.print("Enter String");
      String raw = br.readLine();
  
      if (raw.length() &lt; 10) {
          System.out.println("");
          System.out.println("Please input a valid phone number of at least 10 digits/letters");
          System.out.println("");
      } else {
          if (raw.charAt(3).equals('-') &amp;&amp; raw.charAt(7).equals('-')) {
              System.out.println("2 Hyphens at 3 and 7");
          } else if (raw.charAt(3).equals('-')
                  &amp;&amp; raw.charAt(8).equals('-')) {
              System.out.println("2 Hyphens at 3 and 8");
          } else if (raw.charAt(3).equals('-')
                  &amp;&amp; raw.charAt(9).equals('-')) {
              System.out.println("2 Hyphens at 3 and 9");
          }
      }
  } while (1 &lt; 2);
  </code></pre>