Java application structure:
- Java application is a collection of Source files.
- Source file consists one or more classes.
- Class contains Variables and Methods.
- Java application runs by JVM.
- JVM invoke main() method to start application execution.
- Application starts with one class in which main() method has defined.

How to Compile and Run Java program from command Prompt?
- Open Notepad, Write Code and Save file with .java extension.
- Open Command prompt(CUI based OS).
- Go to file location.
- Compile using command – javac
- Run using – java
Code.java:
public class Code { public static void main(String[] args) { System.out.println(“Hello World!”); } } |
Command Prompt as follows:
