= 0xDEADBEEF; • double double y = 1.1; double exponents = 1.42e5; int x = 4 / 2; // error int y = 5 ~/ 2; // y = 2 • num: int or double num z = 4 / 2; // z = 2.0 (double) z = 2; // z = 2 (int), no error
4; int num2 = 2; final int num5; const int num6 = 6; • var ͘͠໌ࣔతʹܕΛ༩͑ͯఆٛ͢Δɻ • constͱfinalͲͪΒఆΛఆٛ͢Δ͕ɺ constίϯύΠ ϧ࣌ʹ͕ඞཁͰɺfinalίϯύΠϧ࣌ʹෆཁ͕ͩҰ Λ༩͑ΔͱҎ߱มߋෆՄɻ • _num0ͷΑ͏ʹΞϯμʔείΞΛ͚Δͱprivateͷѻ͍ʹͳ Δʢϝιουಉ͡ʣɻ
print(list[3]); } on IndexError { print("Index out of bounds :("); } • catchΛ͚ͭͯྫ֎༰ΛऔΔ͜ͱՄɻ try { var list = [1, 2, 3]; print(list[3]); } on IndexError catch (e) { print("Index out of bounds: $e"); }