About 35,500 results
Open links in new tab
  1. Java Scanner next () Method - W3Schools

    The next() method returns a string containing the next token in the scanner. If the pattern parameter is used, then it will throw an exception when the token does not match the regular expression specified …

  2. java - Understanding Scanner's nextLine (), next (), and nextInt ...

    Sep 26, 2015 · If you change the scanner's delimiter by calling one of the useDelimiter(...) methods, you can cause (for example) next() to return newline characters as part of a token.

  3. Scanner and nextChar () in Java - GeeksforGeeks

    Jul 23, 2025 · Scanner class in Java supports nextInt (), nextLong (), nextDouble () etc.

  4. Scanner (Java Platform SE 8 ) - Oracle Help Center

    int i = sc.nextInt(); Scanner sc = new Scanner(new File("myNumbers")); while (sc.hasNextLong()) { long aLong = sc.nextLong(); The scanner can also use delimiters other than whitespace. This example …

  5. Java Scanner next () Method - Online Tutorials Library

    The java Scanner next (String pattern) method returns the next token if it matches the pattern constructed from the specified string. If the match is successful, the scanner advances past the input …

  6. Java Scanner next (String pattern) method example

    This java tutorial shows how to use the next (String pattern) method of Scanner class of java.util package. This method returns the next token which the Scanner object determined using the String …

  7. Mastering `Scanner.next ()` in Java — javaspring.net

    Nov 12, 2025 · One of the most frequently used methods of the `Scanner` class is `next ()`. This blog post will take an in-depth look at `Scanner.next ()` in Java, covering its fundamental concepts, usage …

  8. Java Scanner next () Method - Tpoint Tech

    Mar 17, 2025 · Java Scanner next (String pattern) Method It is a Scanner class method which returns the next token if it matches the pattern constructed from the specified string.

  9. Java Scanner nextLine Method - Online Tutorials Library

    Learn how to use the nextLine method of the Java Scanner class to read input strings effectively. Explore examples and syntax for better understanding.

  10. Mastering Java Scanner's `next ()` and `nextLine ()` Methods

    Nov 12, 2025 · In Java, the Scanner class is a powerful tool for reading user input from various sources such as the console, files, or strings. Two of the most commonly used methods for reading input with …