JAVA三目运算法&&基础

作者在 2016-12-01 10:36:22 发布以下内容
package fuck;

//import sun.security.provider.JavaKeyStore.CaseExactJKS;

//import com.sun.java.util.jar.pack.Instruction.Switch;
import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory.Default;

public class FenZhi 
{
	public static void main(String[] args)
	{
		Huan();
	}
	
	public static void fen()
	{
		int age = 30;
		if (age >20)
		{
			System.out.println("you're right");
		}
		else
		{
			age--;
			System.out.println(age);
		}
	}
	public static void Shi() 
	{
		int age = 45;
		if (age >20)
		{
			System.out.println("yonger");
		}
		else if (age >40)
		{
			System.out.println("middle");
		}
		else if (age >60)
		{
			System.out.println("older");
		}
	}
	public static void  Cheng() 
	{
		int age = 45;
		if (age >20)
		{
			System.out.println("yonger");
		}
		else if (age >40 && ! (age>20))
		{
			System.out.println("middle");
		}
	
	}
	public static void Tao()
	{
		int age = 45;
		if (age >60)
		{
			System.out.println("older");
		}
		else if (age >40)
		{
			System.out.println("middle");
		}
		else if  (age >20)
		{
			System.out.println("yonger");
		}
	}
	public static void Xi()
	{
		char score = 'C';
		switch (score)
		{
			case 'A':
				System.out.println("you");
				break;
			case 'B':
				System.out.println("liang");
				break;				
			case 'C':
				System.out.println("zhong");
				break;
			case 'D':
				System.out.println("jige");
				break;
			default:
				System.out.println("fuck u ");
		}
	}
	public static void Xue()
	{
		char student ='C';
		switch (student) 
			{
			case 'A':
				System.out.println("A");
				break;
			case 'B':
				System.out.println("B");
				break;
			default:
				System.out.println("fuck u");
			}
	}
	public static void Huan()
	{
		int  count = 0;
		while  (count < 10)
		{
			System.out.println(count);
			count++;
		}
		System.out.println("Huan over");
	}
	
	
}
JAVA | 阅读 1875 次
文章评论,共0条
游客请输入验证码
浏览2354326次