Java.lang.Compiler Class

Java Compiler Class

The Compiler class in the Java.lang package is used to provide Java-to-native-code compilers and related services. The Compiler class is a placeholder for a JIT compiler implementation and does nothing by default.

 

Class declaration

The declaration of java.lang.Compiler class is:

 

public final class Compiler
  extends Object

java.lang.Compiler Methods

The java.lang.Compiler class has a number of methods which are listed below:

 

Member Methods

 

S.N Methods & Description
1. static Object command(Object any)
Examines the argument type and its fields and perform some documented operation.
2. static boolean compileClass(Class<?> clazz)
Compiles the specified class.
3. static boolean compileClasses(String string)
Compiles all classes whose name matches the specified string.
4. static void disable()
Cause the Compiler to cease operation.
5. static void enable()
Cause the Compiler to resume operation.

 

 

Methods inherited

 

This class inherits the methods of following class:

 

  • java.lang.Object

 

To open the online compiler click here.

 

Also Read: Java – Booleans

Leave a Reply

Your email address will not be published. Required fields are marked *