About 56 results
Open links in new tab
  1. How to use hasNext() from the Scanner class? - Stack Overflow

    Dec 18, 2015 · 0 java.util.Scanner.hasNext() basically helps you to read the input. This method returns true if this Scanner has another token of any type in its input. Returns false otherwise. …

  2. list - how hasnext () works in collection in java - Stack Overflow

    how hasnext () works in collection in java Asked 15 years, 5 months ago Modified 10 years ago Viewed 86k times

  3. Difference between next () and hasNext () in java collections

    Feb 23, 2020 · 2 HasNext () : if we are using hasNext () with the while loop for traversing in a collection then it returns a boolean value. hasNext () method check is there any element left in …

  4. How to use hasNext() function in java - Stack Overflow

    Jan 3, 2018 · 0 hasNext() function tells: You have a token (in your case, you have a string). When you invoke the first time hasNext() it returns true (because you have the string s linked in your …

  5. java - No entiendo cómo funciona el método .hasNext () de la …

    Dec 21, 2021 · No entiendo cómo funciona el método .hasNext () de la clase Scanner Formulada hace 4 años y 2 meses Modificada hace 2 años y 2 meses Vista 3k veces

  6. java - What does hasNext () in a While do? - Stack Overflow

    Have you read the documentation of the Scanner.hasNext() method in the API Javadoc? Because if you don't and your first reaction to seeing a method is asking here what it means, you are …

  7. java - use of hasNext () and hasNextInt () - Stack Overflow

    Feb 12, 2024 · 0 As the hasNext () returns True when there is a token in buffer otherwise false And hasNextInt () return true if the token in buffer can be interpreted as int otherwise false. If in …

  8. Usage of Iteration's .hasNext(); and .next(); methods in Java

    Sep 11, 2020 · For 2 days I'm pretty confused about .hasNext (); and next (); methods of Iteration interface especially in while loop. Let me give an example: import java.util.*; // imported whole …

  9. java - Методы hasNext () и Next () - Stack Overflow на русском

    Aug 14, 2021 · Вот поэтому я и не могу понять, из всего, что читал, понял, что hasNext () проверяет есть ли что то или нет, и возвращает true или false, по моей логике он …

  10. Explanation of Scanner.hasNext () method - Stack Overflow

    Sep 5, 2019 · These tokens can be individually extracted from the string with the use of a loop utilizing the Scanner#hasNext () method in conjunction with the Scanner#next () method.