Java Compiler - disable() Method
The java.lang.Compiler.disable() used to cause the Compiler to cease operation.
Syntax
public static void disable()
Parameters
No parameter is required.
Return Value
void type.
Exception
NA.
Example:
In the example below, the java.lang.Compiler.disable() method is used to cause the compiler to cease operation.
public class MyClass { public static void main(String[] args) { //check whether the compiler is enabled or not Compiler.enable(); System.out.println("Compiler is enabled using enable() method."); Compiler.command("{java.lang.Byte.*} (compile)"); //creating Byte object Byte b = new Byte("25"); //printing hashCode of b System.out.println("hashCode of b is: " + b.hashCode()); //disable the compiler Compiler.disable(); } }
The output of the above code will be:
Compiler is enabled using enable() method. hashCode of b is: 25
❮ Java.lang - Compiler