JAVA三目运算法

作者在 2016-12-01 09:46:24 发布以下内容
package fuck;

public class SamM 
{
	public static void main(String[] args)
	{
		String string =5 >3 ? "5 more than 3" :"5 less than 3";
		System.out.println(string);
		
		Lexus();
		Audi();
	}
	
	public static void Cadillac() 
	{
		if (5 >3)
		{
			System.out.println("5 larger than 3");
		}
		else
		{
			System.out.println("less ");
		}
	}
	public static void Lexus() 
	{
		int a = 3 ;
		int b = a + 2*a;
		System.out.println(b);
	}
	public static void  Audi() 
	{
		String str1 = 5 > 3 ? "5 da 3" : "5 xiao 3";
		System.out.println(str1);
	}


}
JAVA | 阅读 827 次
文章评论,共0条
游客请输入验证码