Home / Java Tips Generated By ChatGPT / 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."); }