File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String error" Watch "String error" New topic

String error

Kevin M Brown

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.

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
I agree. Here's the link:
subject: String error
It's not a secret anymore!