title: No output of a code that counts characters of a string
body: <p>I faced a problem while writing a code that counts the characters 
  of a string.
  Generally the code looks right but when i try to run it it gives me no output!
  I don't know exactly where is the problem, hope you can help me to figure it out.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>    String S1;
      char letter=0,number = 0,space=0,Schar=0;
  
      System.out.println("Enter the string:");
      S1=input.nextLine();
  
      int size=S1.length();
  
      for(int index=0; index&lt;size;index++){
      char ch=S1.charAt(index);
  
      if(Character.isLetter(ch)){
      letter++;
      }else if(Character.isDigit(ch)){
      number++;
      }else if(ch==' ')
      space++;
      else 
      Schar++;
  
      }
  
      System.out.println("The string is: " +S1);
      System.out.println("Letter: " +letter);
      System.out.println("Number: " +number);
      System.out.println("Space: " +space);
      System.out.println("Other: " +Schar);
  
  The output:
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/GKtrG.png" rel="nofollow noreferrer">enter image description here</a></p>