https://www.cnblogs.com/bfcs/p/10340002.html

nextLine():返回的是Enter键之前的所有字符,它是可以得到带空格的字符串的。

next()在输入有效字符之后,将其后输入的空格键、Tab键或Enter键等视为分隔符或结束符。

next():会自动消去有效字符前的空格,只返回输入的字符,不能得到带空格的字符串。

nextLine()方法的结束符只是Enter键

(简单说,next只要字,nextLine啥都要)

1.next( )和nextLine( )的区别

https://www.jianshu.com/p/c85c32337cd8

相关文章:

  • 2021-10-10
  • 2022-01-11
  • 2022-12-23
  • 2021-08-21
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-25
  • 2021-08-18
  • 2021-05-09
  • 2021-06-25
  • 2021-07-01
  • 2021-09-11
相关资源
相似解决方案