About 18,000,000 results
Open links in new tab
  1. Java User Input (Scanner class) - W3Schools

    Java User Input The Scanner class is used to get user input, and it is found in the java.util package. To use the Scanner class, create an object of the class and use any of the available methods found in the Scanner class documentation.

  2. How to read integer value from the standard input in Java

    May 2, 2010 · Using console is a simple way to input numbers. Combined with parseInt()/Double() etc. s = cons.readLine("Enter a int: "); int i = Integer.parseInt(s); s = cons.readLine("Enter a double: "); double d = Double.parseDouble(s);

  3. How to Read and Print an Integer Value in Java? - GeeksforGeeks

    Apr 9, 2025 · To read and print an integer value in Java, we can use the Scanner class to take input from the user. This class is present in the java.util package. Example input/output: The Scanner class is used to take input from the user through the console. This class provides different methods to take input from users such as integer, String and boolean etc.

  4. Ways to Read Input from Console in Java - GeeksforGeeks

    Jan 14, 2025 · In Java, there are four different ways to read input from the user in the command line environment (console). 1. Using Buffered Reader Class. Buffered Reader Class is the classical method to take input, Introduced in JDK 1.0.

  5. How to get the user input in Java? - Stack Overflow

    Mar 13, 2011 · DataInputStream is primarily used for reading input as a primitive datatype, from an underlying input stream, in a machine-independent way. DataInputStream is usually used for reading binary data. It also provides convenience methods for reading certain data types.

  6. java - Getting Keyboard Input - Stack Overflow

    Jul 9, 2013 · It is the easiest way to read input in a Java program, though not very efficient. To create an object of Scanner class, we usually pass the predefined object System.in, which represents the standard input stream (Keyboard). For example, this code allows a user to read a number from System.in:

  7. Java Program to Read Number from Standard Input - Tpoint Tech

    In Java, the most popular way to read numbers from standard input is to use the Scanner class. Sometimes, we also use the class BufferedReader class to read a number. It provides different methods related to the input of different primitive types.

  8. Java Program to read integer value from the Standard Input

    Oct 25, 2022 · In this program we will see how to read an integer number entered by user. Scanner class is in java.util package. It is used for capturing the input of the primitive types like int, double etc. and strings.

  9. How to Get User Input in Java

    Learn how to get user input in Java using Scanner class and other methods. Step-by-step guide with code examples to take input from the console efficiently.

  10. How to read integer value from the standard input in Java

    To read an integer value from the standard input (keyboard) in Java, you can use the Scanner class from the java.util package. Here is an example of how you can use the Scanner class to read an integer value from the standard input:

  11. Some results have been removed
Refresh