If-Else Statement in Java


Use if-else to make decisions in your code.

Source Code

int number = 10;
if (number > 0) {
    System.out.println("The number is positive.");
} else {
    System.out.println("The number is not positive.");
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments