About 105,000 results
Open links in new tab
  1. java - How can I input an if statement inside a while loop?

    Jul 30, 2016 · You basically have to check whether the number is less than 0. This is to be done while taking the input. You can just take the input inside a while loop in this manner: …

  2. using an if statement inside a while loop - Stack Overflow

    Apr 28, 2015 · I just figured out how to test for certain conditions and modify output within a loop. But I noticed that testing for two conditionals with the && operator only works in an …

  3. Adding while loop with if statement java - Stack Overflow

    Mar 28, 2016 · Where are you supposed to put a while loop within a if and else if statement to get all choices to run the while loop? System.out.println("a. Add two numbers. "); …

  4. Java while Loop - GeeksforGeeks

    Nov 11, 2024 · Java while loop is a control flow statement used to execute the block of statements repeatedly until the given condition evaluates to false. Once the condition becomes …

  5. Java While Loop - W3Schools

    Loops can execute a block of code as long as a specified condition is reached. Loops are handy because they save time, reduce errors, and they make code more readable. The while loop …

  6. Decision Making in Java (if, if-else, switch, break, continue, jump)

    Apr 16, 2025 · The if-else statement in Java is a powerful decision-making tool used to control the program's flow based on conditions. It executes one block of code if a condition is true and …

  7. Java while Loop (with Examples) - HowToDoInJava

    Jan 2, 2023 · The while statement or loop continually executes a block of statements while a particular condition is true. The condition-expression must be a boolean expression and the …

  8. Implementing conditional statements and loops in Java

    Apr 18, 2023 · Learn how to work with conditional statements and loops in Java, including if statements, switch statements, while loops, do-while loops, for loops, and for-each loops with …

  9. Java For Loop, While Loop, Do-While Loop - JavaPointers

    The Java While Loop is almost the same in For loop but with just a condition statement inside the parenthesis. It doesn’t have an initialization or code execution block. A Java While Loop …

  10. While Loop in Java with examples - First Code School

    Feb 21, 2024 · You can think of a while loop as an If statement that repeats itself. While loops are often used in programming languages when the number of iterations is not known. What is the …

Refresh