三元運算符
(條件表達式)灰瞻?表達式1:表達式2紫岩;
System.out.println(3>2?"正確":"錯誤");
數(shù)據(jù)類型范圍從大到小? byte<char<short<int<long<float<double? ?布爾類型不參與類型轉換
了解了Scanner為鍵盤輸入類型
? ? ?Scanner scanner =new Scanner(System.in)
? ? ? ? int a=scanner.nextInt();
了解Random為隨機類型
? ? ? ?Random random=new Random();
? ? ? ? ? int a=random.nextInt(10);? ? ? ? ? //1-10的隨機數(shù)
? ? ? ? ??int a=random.nextInt(10)+5;? ? ? //5-10的隨機數(shù)
了解了if? ? ? ? ? else{}
知道了三個循環(huán)? ? ?for(int i=0;i<=5;i++){}
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? while(i<=5){? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?do{? ? ? ? ?}while(i<=5)? ? ? ? ??
? ? //sum+=i>>>>sum=sum+i? ? ? ?sum-=i>>>>sum=sum-? i
? ? ??sum*=i>>>>sum=sum*i? ? ? ?sum/=i>>>>sum=sum/i
了解了break是跳出循環(huán)? ?continue是跳出本次循環(huán)