《java》重新學(xué)習(xí)

public class Main {

public static void main(String[] args) {

System.out.println("Hello, World");

byte a=56;

long bigValue =9999;

long bigValue2=9333L;

System.out.println(a);

System.out.println(bigValue);

System.out.println(bigValue2);

int age =30;

if(age > 20){

? System.out.println("年齡");?

}

int a1 = 5;

if(a1>4)

? System.out.println("4-1");

else

? System.out.println("4-2");



int b=5;

if(b>4)

? System.out.println("5-1");

? else

? ? b--;

? ? System.out.println("5-2");


? char score ='C';

? switch(score){

? ? ? case 'A':

? ? ? ? ? System.out.println("a");

? ? ? ? ? break;

? ? ? case 'B':

? ? ? ? ? System.out.println("B");

? ? ? ? ? break;

? ? ? case 'C':

? ? ? ? ? System.out.println("C");

? ? ? ? ? break;

? ? ? case 'D':

? ? ? ? ? System.out.println("D");

? ? ? ? ? break;

? ? ? case 'F':

? ? ? ? ? System.out.println("F");

? ? ? ? ? break;

? ? ? default:

? ? ? ? ? System.out.println("999");


? }


? int count = 0;

? while(count < 10){

? ? ? System.out.println(count);

? ? ? count ++;

? }

? System.out.println("循環(huán)111");


? int count1 = 0;

? while(count1 <10)

? {

? ? ? System.out.println(count1);

? ? ? count1 ++;

? }

? System.out.println("循環(huán)2222");


? int count2 =2;

? do

? {

? System.out.println(count2);

? count2 ++;

? }while(count2 < 10);

? System.out.println("循環(huán)333");


? int count3 =20;

? do

? ? System.out.println(count3++);

? while(count3 < 10);

? System.out.println("循環(huán)444");


? for(int count4=0;count4 < 10 ; count4 ++){

? ? ? System.out.println(count4);

? }

? System.out.println("循環(huán)555");


? for(int i =0;i < 10 ; i ++){


? ? ? for(int j =0;j < 10 ; j ++){

? ? ? ? ? System.out.println("i:"+i + "j:" + j);?

? ? ? }


? }

? System.out.println("循環(huán)666");


? for(int count4=0;count4 < 10 ; count4 ++){

? ? ? System.out.println(count4);

? ? ? if(count4 == 4){

? ? ? ? ? break;

? ? ? }

? }

? System.out.println("循環(huán)77");


? for(int count4=0;count4 < 10 ; count4 ++){

? ? ? System.out.println(count4);

? ? ? if(count4 == 4){

? ? ? ? ? continue;

? ? ? }

? }

? System.out.println("循環(huán)88");

? for(int count4=0;count4 < 10 ; count4 ++){

? ? ? System.out.println(count4);

? ? ? ? for(int count41 =0;count41 < 10 ; count41 ++){

? ? ? if(count4 == 4){

? ? ? ? ? return;

? ? ? }

? ? ? ? }

? }

? System.out.println("循環(huán)99");



}

}

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

推薦閱讀更多精彩內(nèi)容