About 9,300,000 results
Open links in new tab
  1. Prompt for user yes or no input in Java - Stack Overflow

    Apr 19, 2015 · You could change the condition inside the while, with while (!yn) but is more intuitive to let yn true if yes; false if no. return default; don't make much sense, if you want to …

  2. Java Code for Yes/No Prompts - CodePal

    In this tutorial, we will learn how to write a Java function that handles user input for yes/no prompts. This function is useful when you want to prompt the user for a yes/no answer and …

  3. Java String Prompt the user with a question, asking for a yes or no ...

    * Prompt the user with a question, asking for a yes or no response. * The default response if none is given will be 'yes' * @param in the reader to read user input from. * @param out the writer …

  4. How to Create a Yes or No Confirmation Dialog with JOptionPane in Java

    In Java, JOptionPane provides a simple way to prompt users with a dialog box that allows them to make a decision. Specifically, the `showConfirmDialog` method can be used to create a Yes or …

  5. Simplifying Yes/No Input in Java - YouTube

    Mar 18, 2025 · Learn how to streamline user input handling in your Java applications by converting "yes/no" responses into boolean values easily! ---...more.

  6. 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 …

  7. Java User Input – Scanner, BufferedReader and Console

    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 …

  8. java - Yes no checker | DaniWeb

    For example: you can use equalsIgnoreCase inside an if test to see if the String is Yes yes or YES. Similarly you can use a second if to test for Sure sure or SURE.

  9. java - Read in input text Yes/No Boolean from user to proceed …

    Feb 15, 2022 · Use Scanner and get next line, then check if that line is yes or no then handle respectively. In the example below, I used a while loop to keep asking them to input yes or no …

  10. How to Create Java Do-While Loop With User Input - Delft Stack

    Feb 2, 2024 · Taking user’s input in the do-while loop is one of the most useful cases you will come around to. Code Example: Scanner scan = new Scanner(System.in); . String input; . …

  11. Some results have been removed
Refresh