📄 init.mj
字号:
/**
* This program is used to test your compiler can generate
* correct codes to initialize variables.
* The following program is correct and will display nothing.
*/
class Program {
static int i; // i should be initialized to 0.
static boolean b; // b should be initialized to false.
static int j = i+1;
static void main() {
int[LEN*1-0] iarray;
boolean[(LEN)] barray;
if (i!=0) print("error1\n");
if (j!=1) print("error2\n");
if (b!=false) print("error3\n");
if (barray[LEN-1]!=false) print("error4\n");
if (barray[0]!=false) print("error5\n");
if (iarray[LEN-1]!=0) print("error6\n");
if (iarray[0]!=0) print("error7\n");
if (b!=false) print("error8\n");
}
static final int LEN = 2;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -