Output the total number of String Characters
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/10146977/output-the-total-number-of-string-characters">Output the total number of String Characters</a>  </p>
</blockquote>



<p>My Question is what method should I use if I wanted to get the total number of characters a user inputs? without using arrays, i tried using .length() but it did not return all characters say from the first and lastname, it only returned the first name. </p>

<p>Here's an example of my code. (Please dont laugh im really new in programming :) )</p>

<pre><code>System.out.print("Enter your first and last name: "); 
               String yourName = keyboard.next(); 
System.out.println("Your name has a total of " + yourName.length() + " numbers");
</code></pre>

<p>what happened was if i enter say "Neo Matrix" it would only return "Neo" which is 3.</p>

<p>I appreciate any help. thank you!</p>
