Compiler Class provides support and related services to Java code to Native Code.
Native code is a form of code that can be said to run in a virtual machine (for example, [JVM]Java Virtual Machine).
public final class Compiler extends Object
- command() : java.lang.Compiler.command() tests the argument type and performs some documented operations.
public static boolean command(Object argument) Parameters : argument : needs to be compiler specific. Return : compiler specific value Exception : -> NullPointerException
- compileClass() : java.lang.Compiler.compileClass() compiles the specified class.
public static boolean compileClass(Class c) Parameters : c : class to be compiled. Return : true if the compilation succeeded else, false Exception : -> NullPointerException
- enable() : java.lang.Compiler.enable() cause compiler to start operation.
public static void enable() Parameters : ------ Return : void
- disable() : java.lang.Compiler.disable() stops compiler to perform operations.
public static void disable() Parameters : ------- Return : void
- compileClasses() : java.lang.Compiler.compileClasses() compiles the classes having the name as string – “str”
public static boolean compileClasses(String string) Parameters : str : name of the class to be compiled Return : true if the classes are compiled successfully Exception : -> NullPointerException
class NewClass$CompilerClass Value : null Is compilation successful ? : false Is compilation successful using str ? : false
lang.Compiler Class inherits others methods from Object class in Java.
This article is contributed by Mohit Gupta_OMG 😀. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Implement Octet Class from Septet Class in Java using JavaTuples
- Implement Quintet Class with Quartet Class in Java using JavaTuples
- Implement Pair Class with Unit Class in Java using JavaTuples
- Implement Triplet Class with Pair Class in Java using JavaTuples
- Implement Quartet Class with Triplet Class in Java using JavaTuples
- Implement Septet Class from Sextet Class in Java using JavaTuples
- Implement Decade Class from Ennead Class in Java using JavaTuples
- Implement Sextet Class from Quintet Class in Java using JavaTuples
- Implement Ennead Class from Octet Class in Java using JavaTuples
- Difference between Abstract Class and Concrete Class in Java
- In Java, Can we call the main() method of a class from another class?
- Using predefined class name as Class or Variable name in Java
- Java.lang.Class class in Java | Set 1
- Java.lang.Class class in Java | Set 2
- Java.util.concurrent.RecursiveTask class in Java with Examples
- Java.util.concurrent.RecursiveAction class in Java with Examples
- Java.util.BitSet class methods in Java with Examples | Set 2
- Java.util.concurrent.Phaser class in Java with Examples
- Java class dependency analyzer in Java 8 with Examples
- Java.awt.image.RescaleOp Class in Java with Examples