⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 init.mj

📁 编译器mips版后端
💻 MJ
字号:
/**
 * This program is used to test whether your compiler can
 * find errors that variables miss initialization or initialize
 * with variables undeclared before.
 * The following program is wrong. Your compiler should find
 * out the error. And it's better to point out the exact
 * position of the error and output useful information about 
 * this error.
 */
 
class Program {
    static final int i1;    // ERROR: final variable should be explicitly initialized when declaring
    static final int i=j;   // ERROR: j is declared after this declaration
    static final int i2=0;
    
    static int [j] a;       // ERROR: j is declared after this declaration
        
    static void main() {
        print(s);           // ERROR: s is not initialized explicitly#
        s = "abc";
        int[j] c;
        int[i2] d;          // ERROR: the length i2 is not a positive integer#
        return;
    }
    static final int j=10;
    static int [j] b;
    
    static String s;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -