It was the first word I saw while studying, so I scribbled it in my own way while referring to it. I will continue to do it.
A boolean type is data that is determined to contain either true or false data. You don't need anything other than true false.
(Tentative)
public static boolean isHealthy(double bmi) {
return bmi >= 18.5 && bmi < 25.0;
}
if (isHealthy(bmi)) {
system.out.println("I'm healthy");
} else {
System.out.println("Not healthy");
}
Recommended Posts