After java 11, now a single java file might be tested easily with compiling as well. You can check the below given example:
public class Tester { public static void main(String[] args) { System.out.println("Hello World!"); } }
$ javac ApiTester.java $ java Tester Hello World!
$ java ApiTester.java Hello World!
This new attribute will help the developer to quickly test functionality without compiling it before running a code.