?? invalidoperation.mj
字號:
/**
* This program is used to test whether your compiler can find out
* some invalid operations about array.
* The following program is wrong. Your compiler should find out the
* errors. And it's better to point out the exact posiotions of the
* errors and output useful information about the errors.
*/
class Program {
static void main() {
int[] a1 = {1,2,3,}; // ERROR: initialization expression should not end with ","
int[3] a2 = {1,2,3};
int[3] a3 = a2; // ERROR: invalid assignment
String s1 = "abc", s2=s1; // CORRECT
int l = a2.length;
l = s1.length; // ERROR
}
int[] f(int[] i) { //ERROR: method can't return an array.
return i;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -