English 中文(简体)
Java 11 - Compile free Launch
  • 时间:2024-12-22

Java 11 - Compile free Launch


Previous Page Next Page  

Java 11 onwards, now a single java file can be tested easily without compipng as well. Consider the following example −

ApiTester.java


pubpc class Tester {
   pubpc static void main(String[] args) {
     System.out.println("Hello World!"); 
   }
}

Old way of running file


$ javac ApiTester.java
$ java Tester
Hello World!

New way of running file


$ java ApiTester.java
Hello World!

This new feature will help developer to quick test a functionapty without need to compile before running a code.

Advertisements