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

    Java has the following conditional statements: 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 below, we test two values to find out if 20 is greater than 18.

  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. Example:

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

    The Java if...else statement is used to run a block of code under a certain condition and another block of code under another condition. In this tutorial, we will learn about if...else statements in Java with the help of examples.

  4. 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.

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

    Sep 11, 2022 · If else statement in Java. This is how an if-else statement looks: 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. Example of if …

  6. Java If Statement – Syntax, Examples - Tutorial Kart

    In this tutorial, we learned how to use the if statement in Java to control the flow of your program based on conditions. With clear examples, we demonstrated how to check if a number is positive, how to determine if a number is even, and what happens when a condition is false.

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

    Jan 2, 2023 · Java if-else statements help the program execute the blocks of code only if the specified test condition evaluates to either true or false. The if-else statement in Java is the most basic of all the flow control statements.

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

    In Java, the if statement is a conditional statement used to execute a block of code when a specified condition evaluates to true. If the condition is false, an optional else statement can be used to execute an alternative block of code.

  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 else Statement with Examples - First Code School

    May 15, 2024 · There are four types of If Else statements: 1. If. 2. If-Else. 3. If-ElseIf-Else. 4. Nested If. Let us take a look at each type with the help of a flowchart, syntax, and an example with output. 1. Simple If statement.

  11. Some results have been removed
Refresh