Java基础

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

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

import org.omg.CORBA.PUBLIC_MEMBER;

//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();
//		Fen();
//		Ford();
//		Cadillac();
//		ForM();
		Test();
	}
	
	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(count++);
		}
		System.out.println("Huan over");
	}
	public static void Fen() 
	// 有分号的代表一个空语句,分号的代码块和while循环没有关系
	{
		int count = 0;
		while (count <10);
		{
			System.out.println("-----"+ count);
			count++;
		}
	}
	public static void Ford()
	//do while循环先执行循环体,然后判断循环条件,如果为真,执行下一次循环
	//否则循环中止
	
	{
		int count =0;
		do 
			{
			System.out.println(count);
			count++;
			}
			while (count < 10);
			{
				System.out.println("game over");
			}
	}
	public static void Cadillac() 
	{
		int count2 = 40;
		do
			{
				System.out.println(count2++);
			}
		while (count2 <20);
			{
				System.out.println("fuck");
			}
	}
	public static void ForM()
	{
		for (int count =0 ; count <10 ;count ++)
			{
				System.out.println(count);
			}
			System.out.println("over");
	}	
	public static void Test()
	{
		for (int b = 0,s = 0,p =0; b<10 && s <4 && p<10; p++ )
			{
				
				System.out.println(b++); 	//0123456789
				System.out.println(++s +p); //1 3 5 7
				System.out.println(++s);	//1 2 3 4 
				System.out.println(s++); 	//0 1 2 3
				
				
			}
		
		for (int count =0 ; count < 10 ; count++)
			{
				System.out.println(count);
				count *=0.1;		//死循环
			}
			System.out.println("over");
		for ( ; ; )
			{
				System.out.println("suck my dick");	//死循环
			}
		
		
		for (int count1 = 0 ; count1 <10 ; )
			{
				System.out.println(count1);//012345679
				count1++;
			}
			System.out.println("over");//over
			
		int tmp =0;
		int count = 0;
		for (int i = 0 ; i < 10 ; i++)
			{
				System.out.println(i);	//0123456789
				tmp = i;
			}
			System.out.println("over");
		for (int i = 0 ; i < 5 ; i++)
			{
				for (int j = 0 ;j < 3; j++)
					{
						System.out.println("i 's value:" + i + ",j's value " + j);
					}
			}
		for (int s=0 ; s <=5 ; s++)
			{
				for (int t =0 ; t <=6 ; t++ )
					{
						System.out.println("s values" + s +",t values" + t);
					}
			}
		for (int s = 0 ; s < 5 ; s++)
			{
				System.out.println("s values" + s );
				if (s == 2)
					{
						System.out.println("motherfuck");
						break;
						/*s values0
						s values1
						s values2
						motherfuck */
					}
			}
	
	}
 
}
JAVA | 阅读 1113 次
文章评论,共0条
游客请输入验证码
浏览2354335次