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

📄 innernamedconstant_2.java

📁 是一款用JAVA 编写的编译器 具有很强的编译功能
💻 JAVA
字号:
/* * @test  /nodynamiccopyright/ * @bug 4095568 4277286 4785453 * @summary Verify rejection of illegal static variables in inner classes. * @author William Maddox (maddox) *  * @run shell InnerNamedConstant_2.sh */public class InnerNamedConstant_2 {    static class Inner1 {	static int x = 1;		   // OK - class is top-level	static final int y = x * 5;	   // OK - class is top-level	static final String z;		   // OK - class is top-level	static {	    z = "foobar";	}    }    class Inner2 {        static int x = 1;                  // ERROR - static not final        static final String z;             // ERROR - static blank final	{            z = "foobar";                  // Error may be reported here. See 4278961.	}    }    // This case must go in a separate class, as otherwise the detection    // of the error is suppressed as a result of recovery from the other    // errors.    class Inner3 {        static final int y = Inner1.x * 5; // ERROR - initializer not constant    }}

⌨️ 快捷键说明

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