はじめての記事です。気合いれましょう。シャオラ。 【現象】nextInt()のあとにnextLine()を書くとスキップされる ①例えばこのようなコードがあるとします。(Scannerクラスは”scanner”としてimportしてある状態) System.out.println("あなたの名前を入力してください。
Community driven content discussing all aspects of software development from DevOps to design patterns.
スキャナから値を読み込む場合で区切り文字までの値を順に取得する代わりに行単位で値を取得する場合も試しておきます。行単位で値を取得する場合は next メソッドの代わりに nextLine メソッドを使用します。 nextLine メソッドの詳細な使い方は「区切り ...
Community driven content discussing all aspects of software development from DevOps to design patterns. The Java Scanner class is a simple, versatile, easy-to-use class that makes user input in Java ...