The figure below describes how a java application is created and run
· Source code files are created and saved with .java extension
· Source code files then are compiled into .class files by using java compiler,the javac command
· Execute .class files by running Java Launcher,the java command. You notice two points here:
Code in the .class files is the machine language of the Java Virtual Machine only. A new instance of Java Virtual Machine is created first to interpret code in the .class file as native to the Java Launcher
The Java Launcher then run your application with input as the instance of Java Virtual Machine above
The HelloWorld application above is very simple,it contains a class with only method. The main method is the unique entry point of the application. When running the application,the Java Launcher will look up and execute the main first.
The main method follows java specification,it’s a public static void method with input parameters used as command line parameters (args).
The main method in this application implements only task,printing out the greet Hello Java World by invoking the println method of JDK APIs |