Source: http://www.imooc.com/code/1353
In life, we often need to make judgments before deciding whether to do something. For example, if your test score is greater than 90, reward an IPHONE 5S. You can use the if condition statement to implement situations where you need to determine the condition before the condition is met.
Syntax:
Execution process:
Such as:
Note: If the IF condition is set when the execution statement is only one, it is possible to omit the curly brace drop! But if there are multiple execution statements, then curly braces are indispensable.
Task
time for the inspection. !
Please complete the code in the blank of the editor and implement the function "judging if the value of variable one is even"
Operation Result:
1 Public classHelloWorld {2 Public Static voidMain (string[] args) {3 intone = 20 ;4 if(one% 2 = = 0) { 5System.out.println ("One is even");6 }7 }8}
Web-android Engineer first form -4-1 Java conditional statement if