Answers for "can you have an else statement with a condition in java"

1

how to make if else statments in java

if (condition) {
  // code block
} else {
  // code block
}
Posted by: Guest on April-15-2021
0

if else java

public class TestIfElse {

    public static void main(String[] args) {
        int a = 5, b = 6;
        if (a > b) {
            System.out.println("a is greater");
        } else {
            System.out.println("b is greater");
        }
    }
}
Posted by: Guest on November-24-2020
1

how to make if else statments in java

if (condition) {
  // code block
} else {
  // code block
}
Posted by: Guest on April-15-2021
0

if else java

public class TestIfElse {

    public static void main(String[] args) {
        int a = 5, b = 6;
        if (a > b) {
            System.out.println("a is greater");
        } else {
            System.out.println("b is greater");
        }
    }
}
Posted by: Guest on November-24-2020

Code answers related to "can you have an else statement with a condition in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language