标签:使用 stat void 老师 public ccf color bsp sys
一:什么是if结构?
语法1:
public class Demo {
public static void main (String [] args){
//语句1;
//语句二;
if(条件){
//语句3;
}
//语句4;
}
}
二:使用if-else选择结构
语法2:
if ( 条件 ) {
//代码块1
}else {
//代码块2
}
事例2:
public class SimpleIF {
public static void main (String [] args){
int score = 91;
if (Score >=98) {
System.out.println("老师说:不错,奖励一个MP4!");
} else {
System.out.println("老师说:惩罚进行编码!");
}
}
}
标签:使用 stat void 老师 public ccf color bsp sys
原文地址:http://www.cnblogs.com/QiliPING9/p/7574269.html