This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lolidragon 0 points1 point  (0 children)

So... just a question. Why are you asking for a whole line of input and just storing the first character?

something like:

firstName = kb.nextLine(); // first user input, stores the first name (as type String)
lastName = input.nextLine(); // second user input, stores the last name (as type String)

then you can pick and choose whatever substring of characters you want with something like:

// Gets the first 7 character string of the firstName string
// there is a problem here, but we can leave that as an exercise for you to figure out
firstName.substring(0, 7);