Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

If Else In Java

// Traditional way
if (20 > 18) {
  System.out.println("20 is greater than 18");
}

// "efficient" way
int time = 20;
String result = (time < 18) ? "Good day." : "Good evening.";
System.out.println(result);
 
PREVIOUS NEXT
Tagged: #If #Else #In #Java
ADD COMMENT
Topic
Name
6+3 =