System.out.print ("Enter name: ");
sName = keyboard.nextLine();
System.out.print ("Enter hours worked: ");
shHours = keyboard.nextShort();
I have this piece of code in my program! Sname is declared as a string. When I run the program it displays:
Enter name: Enter hours worked:
It does not allow me to enter the name. The program skips it and jumps to Enter hours worked: . Does anyone have any suggestions!
2007-02-20
08:53:41
·
1 answers
·
asked by
jhn_grz
3
in
Computers & Internet
➔ Programming & Design