流程控制語句
三種基本流程:順序贸人、分支、循環(huán)痘系。
注釋
JavaDoc
分支語句:判斷閏年
if ((year %4 ==0 && year %100 != 0) || (year %400 == 0)) {
return true;
}
return false
switch
image.png
循環(huán)語句
Goto語句
image.png
數(shù)組
在Java中,數(shù)組都是保存在堆中的饿自,沒有保存在棧中的汰翠。
數(shù)組的聲明
數(shù)組的定義
image.png
靜態(tài)初始化
默認(rèn)初始化
image.png
image.png
復(fù)制數(shù)組
多維數(shù)組