Imagine being able to execute a Java application without compilation; for instance, if you define the following Java class in HelloNoCompilation.java:
class HelloNoCompilation { public static void main(String[] args) { System.out.println("No compilation! Are you kidding me?"); } }
With Java 11, you can execute it using the following command (no compilation takes place):
> java HelloNoCompilation.java
Note that the preceding command starts the JVM using java, which is passed the name of a source file with the .java extension. In this case, the class is compiled in memory before it is executed by the JVM. This applies to multiple classes or interfaces that are defined within the same source file. Here's another example (consider it to be defined within the same HelloNoCompilation.java source...