This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes String error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String error" Watch "String error" New topic
Author

String error

Kevin M Brown
Greenhorn

Joined: Nov 06, 2012
Posts: 3
Hi all, just having a small problem I'm sure you pros instantly know the answer to.

Here's the code



When I enter in my whole name - "Kevin Brown" - it prints my last one only, or an error. Do I need to use nextLine() or something?
I'm using BlueJ.
Thanks,

-Kevin
Rameshwar Soni
Ranch Hand

Joined: Feb 03, 2011
Posts: 247
Kevin M Brown wrote: Do I need to use nextLine()


Yes you are correct. You could have tried that.

Anyways, Welcome to Ranch
 
Consider Paul's rocket mass heater.
 
subject: String error
 
It's not a secret anymore!