About 17,000,000 results
Open links in new tab
  1. java - How to get boolean user input using scanner ... - Stack Overflow

    Feb 6, 2015 · Scanner n = new Scanner(System.in); boolean bn = s.nextBoolean(); if (bn == true) { // do stuff } else if (bn == false) { // do stuff } } catch (InputMismatchException e) { …

  2. Scanner nextBoolean() method in Java with Examples

    Oct 12, 2018 · The nextBoolean() method of java.util.Scanner class scans the next token of the input as a Boolean. If the translation is successful, the scanner advances past the input that …

  3. Java User Input (Scanner class) - W3Schools

    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 …

  4. How To Take Input In Java | Scanner Class & More (+Examples) …

    Let’s break down the steps to take user input in Java using BufferedReader. Import Required Classes: Import java.io.BufferedReader, java.io.InputStreamReader, and java.io.IOException …

  5. Java User Input – Scanner, BufferedReader and Console - Intellipaat

    May 14, 2025 · Learn how to take user input in Java using Scanner, BufferedReader, and Console with clear examples. Master interactive Java programs with step-by-step input …

  6. Java Input with Scanner - CodersLegacy

    This article will explain how to take input from the user using the Java Scanner class. There are ways than one to take input from the user in Java, and the Scanner class is only of them. …

  7. java - How can get boolean user Input - Stack Overflow

    Aug 26, 2017 · According to the docs of nextBoolean(), it would scan the next token of the input into a boolean value and returns that value. So as rightly pointed out by @Kevin in the …

  8. Java User Input – Scanner Class - GeeksforGeeks

    Apr 22, 2025 · The most common way to take user input in Java is using the Scanner class. It is a part of java.util package. The scanner class can handle input from different places, like as we …

  9. How to Take Input in Java - Scientech Easy

    Feb 10, 2025 · Learn how to take input in Java from user or keyboard using BufferedReader and Scanner, take integer, float, string, double, etc. input value

  10. How to get the user input in Java? - W3docs

    You can also use the nextBoolean method to get a boolean input, and the next method to get a token (a series of characters separated by whitespace). Remember to close the scanner when …

  11. Some results have been removed
Refresh