samedi 1 novembre 2014

Scanner input string without spaces?


Vote count:

0




I was wondering how I can do this.


I was told to use kb.nextLine() instead of kb.next() , but that just results in the input being skipped when I run the program.


String address; student.setAddress(address = kb.nextLine());


I was then told to do this to fix it:


student.SetAddress(String address = kb.nextLine());


but I get an error: "String cannot be resolved into a variable" "Syntax error on token "address" "



asked 22 secs ago







Scanner input string without spaces?

Aucun commentaire:

Enregistrer un commentaire