About 45,700,000 results
Open links in new tab
  1. Java If ... Else - W3Schools

    Use the if statement to specify a block of Java code to be executed if a condition is true. Note that if is in lowercase letters. Uppercase letters (If or IF) will generate an error. In the example …

  2. Java if statement - GeeksforGeeks

    Nov 22, 2024 · The Java if statement is the most simple decision-making statement. It is used to decide whether a certain statement or block of statements will be executed or not i.e. if a certain condition is true then a block of statements is executed otherwise not.

  3. The if-then and if-then-else Statements (The Java™ Tutorials > …

    The if-then-else statement provides a secondary path of execution when an "if" clause evaluates to false. You could use an if-then-else statement in the applyBrakes method to take some action if the brakes are applied when the bicycle is not in motion.

  4. Conditionals - The If Statement - Java Made Easy!

    An if statement is used in Java when you want code to happen whenever a condition exists. We will look at how to create one and how to use them.

  5. Java if...else (With Examples) - Programiz

    Java if...else (if-then-else) Statement. The if statement executes a certain section of code if the test expression is evaluated to true. However, if the test expression is evaluated to false, it does nothing. In this case, we can use an optional else block.

  6. If, If..else Statement in Java with Examples - BeginnersBook

    Sep 11, 2022 · if(condition) { Statement(s); } else { Statement(s); } The statements inside “if” would execute if the condition is true, and the statements inside “else” would execute if the condition is false.

  7. If-Else Statement in Java - Online Tutorials Library

    If-Else Statement in Java - Learn how to use if-else statements in Java to control the flow of your program. Understand syntax, examples, and best practices.

  8. Java If-else (with Examples) - HowToDoInJava

    Jan 2, 2023 · The if-else statement in Java is the most basic of all the flow control statements. An if-else statement tells the program to execute a certain block only if a particular test evaluates to true, else execute the alternate block if the condition is false.

  9. If-Else Statement in Java - Baeldung

    Jan 8, 2024 · In this tutorial, we’ll learn how to use the if-else statement in Java. The if-else statement is the most basic of all control structures, and it’s likely also the most common decision-making statement in programming. It allows us to execute a certain code section only if a specific condition is met. 2. Syntax of If-Else.

  10. Java If, If-Else, Nested If, and If-Else-If Statements - Java Guides

    In this quick article, we will learn Java if statement and different types of if statement in Java, which is used to test the condition. It checks boolean condition: true or false.

  11. Some results have been removed