if demo

package com58.bj.java;

public class IfDemo {

	/**
	 * @param args
	 * if分支語句
	 */
	public static void main(String[] args) {
		int i = 20;
		if (i < 20 ){
			System.out.println("i<20");
		}
		else if(i < 40){
			System.out.println("i>=20 and i<40");
		}
		else if(i < 60){
			System.out.println("i>=40 and i<60");
		}
		else{
			System.out.println("i>=60");
		}
	}

}
相關文章
相關標籤/搜索