title: program to show if the value is alphabet then print "Alphabet" if it’s a number then print "Digit" and for other characters print "Special Character"?
body: <p>I have completed the program but in case of negative numbers it shows special character but I don't want that I want it should display number.</p>
  
  <pre><code>public class DigitAlphabetSpecialCharacter {
  public static void main(String args[])
  {
      Scanner scanner=new Scanner(System.in);
      char char1 =scanner.next().charAt(0);
      if(char1&gt;=48 &amp;&amp; char1&lt;=57)
      {
          System.out.print("char is Digit");
  
      }
      else if((char1&gt;='a' &amp;&amp; char1&lt;='z')||(char1&gt;='A' &amp;&amp; char1&lt;='Z'))
      {
          System.out.print("char is Alphabet");
      }
      else
      {
          System.out.print("char is special character");
  
      }
  }
  </code></pre>
  
  <p>}
  can anyone tell how to use negative numbers'ASCII value or an alternative suggestion?</p>