0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

よしおじ、nextを知る。

Posted at

nextLine();とnext();の違いを少しだけ学んだ。

  • nextはスペースで文字を区切って文字列として受け取る。
  • nextLineはEnterで区切って文字列を受け取る。

nextIntは文字しか受け取らずEnterを受け取ってくれないのでこれまでnextLineで消化していたが、それでは一行完全に空いてしまう事が悩みだったが、これで解決しそう。

int型が必要になったらint変換メソッドの出番だ。うろ覚えだけどparseIntだったろうか。

ドキュメント読んだらParseIntでよさそう。なんならn進数も出来るっぽい。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?