static void disable()
描述 (Description)
java.lang.Compiler.disable()方法导致编译器停止操作。
声明 (Declaration)
以下是java.lang.Compiler.disable()方法的声明
public static void disable()
参数 (Parameters)
NA
返回值 (Return Value)
此方法不返回任何值。
异常 (Exception)
NA
例子 (Example)
以下示例显示了java.lang.Compiler.disable()方法的用法。
package com.iowiki;
import java.lang.*;
public class CompilerDemo {
public static void main(String[] args) {
// checking if compiler is enabled or not
Compiler.enable();
System.out.println("Compiler Enabled...");
Compiler.command("{java.lang.Integer.*}(compile)");
Integer i = new Integer("30");
// returns a hash code value
int retval = i.hashCode();
System.out.println("Value = " + retval);
// disable the compiler
System.out.println("Disabling Compiler...");
Compiler.disable();
}
}
让我们编译并运行上面的程序,这将产生以下结果 -
Compiler Enabled...
Value = 30
Disabling Compiler...