Compiling and Running:  

         . Java source file  👉     Java     👉  .class ( Byte code ) 

                                                                                👇                                                                             Output 👈   java (JDK)

The process of compiling and running a Java program involves two main steps:

1. Compilation

Java source code (written in .java files) must be compiled into bytecode (.class files) before it can be executed by the Java Virtual Machine (JVM).

Steps:

  1. Write Java code in a text editor or an Integrated Development Environment (IDE) and save it as a .java file.

  2. Compile the code using the java.c (Java Compiler) command.






Copy Command Box
javac MyProgram.java

Comments

Popular Posts