Home » Java programming language

Java Compiler enable() method with example

Compiler Class enable() method: Here, we are going to learn about the enable() method of Compiler Class with its syntax and example.
Submitted by Preeti Jain, on December 02, 2019

Compiler Class enable() method

  • enable() method is available in java.lang package.
  • enable() method is used to cause the compiler to resume operation which is stopped by using a disable() method.
  • enable() method is a static method, it is accessible with the class name and if we try to access the method with the class object then we will not get any error.
  • enable() method does not throw an exception at the time of resuming operation.

Syntax:

    public static void enable();

Parameter(s):

  • It does not accept any parameter.

Return value:

The return type of this method is void, it returns nothing.

Example:

// Java program to demonstrate the example 
// of void enable() method of Compiler 

public class Enable {
    public static void main(String args[]) {

        // This code is to check whether Compiler is enabled or not 
        Compiler.enable();
        System.out.println("Enabled Compiler by using enable() ");

        Compiler.command("{java.lang.Byte.*} (compile)");

        byte by = 20;
        Byte b = new Byte(by);

        // Display value
        System.out.println("b = " + b);
    }
}

Output

Enabled Compiler by using enable() 
b = 20






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.