Loading...
「ツール」は右上に移動しました。
利用したサーバー: natural-voltaic-titanium
6いいね 236回再生

Scanner Class in Java | Tecky World | #javashorts

The Scanner class in Java is used for reading user input from the standard input stream, such as the keyboard. It provides methods for parsing various primitive data types and strings from the input source. The Scanner class is part of the java.util package. It can be used to read data of various types, such as int, float, or string. To use the Scanner class, you need to create a new Scanner object and then call its methods to read the input data.
To accept different data types in the Scanner class, you can use the following methods:

nextInt() for reading integer input
nextFloat() for reading float input
nextDouble() for reading double input
nextLine() for reading string input
nextBoolean() for reading boolean input
nextLong() for reading long input
etc.

コメント