My question is, what method should I use if I want to get the total number of characters entered by the user? without using arrays, I tried using .length (), but it did not return all the characters from the first and last name, it only returned the first name.
Here is an example of my code. (Please don't laugh, I'm really new to programming :))
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");
what happened if i enter, say "Neo Matrix", he will return only 3.
I appreciate any help. thanks!
source share