Here is an example of Java if-else coding:

int num = 10;

if(num > 0){
   System.out.println(num + " is a positive number.");
}
else{
   System.out.println(num + " is a negative number.");
}

This code checks if the variable num is greater than 0. If it is, then it prints out that num is a positive number. If num is not greater than 0, then it prints out that num is a negative number.

Java if else cording

原文地址: https://www.cveoy.top/t/topic/sCz 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录