title: How to capitalize the first letter of a String in Java?
body: <p>I am using Java to get a <code>String</code> input from the user. I am trying to make the first letter of this input capitalized.</p>
  <p>I tried this:</p>
  <pre><code>String name;
  
  BufferedReader br = new InputStreamReader(System.in);
  
  String s1 = name.charAt(0).toUppercase());
  
  System.out.println(s1 + name.substring(1));
  </code></pre>
  <p>which led to these compiler errors:</p>
  <ul>
  <li>
  <blockquote>
  <p>Type mismatch: cannot convert from InputStreamReader to BufferedReader</p>
  </blockquote>
  </li>
  <li>
  <blockquote>
  <p>Cannot invoke toUppercase() on the primitive type char</p>
  </blockquote>
  </li>
  </ul>