If of a Java conditional statement
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: 650) this.width=650; "src=" http://img.mukewang.com/5364ef240001832c01830068.jpg "/>
Execution process: 650) this.width=650; "src=" http://img.mukewang.com/53635a6b00011ebc01660184.jpg "/>
such as: 650) this.width=650; "src=" http://img.mukewang.com/5364edff0001e2f004580095.jpg "/>
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.
Code:
public class HelloWorld {
public static void Main (string[] args) {
int one = 20;
if (one%2==0) {
System.out.println ("One is even");
}
}
}
Operation Result:
One is an even number
This article is from "Ghost" blog, please make sure to keep this source http://caizi.blog.51cto.com/5234706/1547684
Java Basis---Java conditional statement if (17)