目录

static void enable()

描述 (Description)

java.lang.Compiler.enable()方法使编译器恢复操作。

声明 (Declaration)

以下是java.lang.Compiler.enable()方法的声明

public static void enable()

参数 (Parameters)

NA

返回值 (Return Value)

此方法不返回任何值。

异常 (Exception)

NA

例子 (Example)

以下示例显示了java.lang.Compiler.enable()方法的用法。

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("50");
      // returns a hash code value
      int retval = i.hashCode();
      System.out.println("Value = " + retval); 
   }
} 

让我们编译并运行上面的程序,这将产生以下结果 -

Compiler Enabled...
Value = 50
↑回到顶部↑
WIKI教程 @2018