Types Definition Syntax if-else Used in singular condition if (condition) { statement statements like yes or no //statement } else { //statement } else-if if (condition) { statement //statement } Else if (condition){ //statement } else { //statement } if statement if (condition) { //statement } if (condition) { //statement }
public class conditional1{
public static void main(String args[]){ Double temp = 38.0; if(temp>=37.5){ System.out.println("!! You have a fever !!"); } else{ System.out.println("You are at a normal temperature!"); } } }