Java Compiler compileClass() method

The compileClass(Class<?> clazz) method of the Java Compiler class is used to compile the specified class.

Syntax

Parameters

Clazz - The class which is to be compiled.

Return

A Boolean value, i.e., true if compilation succeeds and else false.

Example 1

Test it Now

Output:

g1
g2
Value returned by method is : false




Latest Courses