About 1,040,000 results
Open links in new tab
  1. java - How do I make a if-else statement with the string

    Nov 25, 2014 · if (input.equals(yes)) { System.out.println("Your name is: " + name); } else if (input.equals(no)) { System.out.println("Enter your name again"); } Because the statement: …

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

  3. Java If else Statement on String value, with Scanner input

    Aug 29, 2018 · I’m writing a program in the Java language, and I’m using if else statement. In this program i need to input word(s), i.e., alphabet character that has been assigned to be the …

  4. Java if-else Statement - GeeksforGeeks

    Dec 3, 2024 · 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 …

  5. Java If ... Else - W3Schools

    Use the if statement to specify a block of Java code to be executed if a condition is true. Syntax if ( condition ) { // block of code to be executed if the condition is true }

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

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

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

    Java provides several types of control flow statements: 1. If Statement. The if statement is used to test a condition. If the condition evaluates to true, the block of code inside the if statement is …

  9. Java Real-Life If Else Examples - W3Schools

    This example shows how you can use if..else to "open a door" if the user enters the correct code: int doorCode = 1337; if (doorCode == 1337) { System.out.println("Correct code. The door is …

  10. Simple if else Java Example - Java Code Geeks

    Nov 11, 2012 · 2.2 Java if else Statement. The if else statement tests the condition and executes the if block if the condition evaluates to true otherwise the else block, is executed. Let us …

Refresh