title: BlueJ - My program compiles with no errors but doesn't run
body: <p>Hello I'm having problems with a program that's supposed to take in a string and then capitalize the first letters of each word using the Character Wrapper class. </p>
  
  <pre><code> import java.util.*;
  public class wrapper
  {
      public static void main(String[] args)
      {
          Scanner input= new Scanner(System.in);
          String s1;
          s1=input.nextLine();
          s1= s1.trim();
          int howLong= s1.length();
          int i;
          int counter=0;
          char cho;
          for(counter=1; counter&lt;= howLong+1; counter++)
          {
              cho=s1.charAt(counter);
              if(Character.isLetter (cho) &amp;&amp; ! Character.isLetter(s1.charAt(counter-1)))
              {
                  System.out.print( Character.toUpperCase(cho) );
              }
              else
              {
                  System.out.print(cho);
              }
              System.out.println();
          }
  
          }
      }
  </code></pre>
  
  <p>That's the program so far, but while it compiles with no errors according to BlueJ, it doesn't run. Any help as to why this is happening would be great.  </p>
  
  <p>Edit: Changed the program to what I believe would make it not just print out the spaces that the char variable was initialized to, but it still does not run. Maybe there's something wrong with the loop?       </p>