# next()
- next(),只scan下个字符
- nextline(),scan 整行
- nextInt(),只scan下个数字,其他的都留在了缓冲区
### 处理办法:
- s.nextline()清除缓冲区;
~~~
Scanner s= new Scanner(System.in);
System.out.println("enter your salary of month");
while(!s.hasNextInt())
{
//s.next()吃掉一个回车
s.nextLine();//吃掉剩余的行
System.out.println("invalid input,try again.");
System.out.println("enter your salary of month");
s.hasNextInt();
}
~~~