Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 880 Bytes

Java Programming Steps.md

File metadata and controls

34 lines (23 loc) · 880 Bytes

Java Programming Steps

1. Write the code "ClassName.java"

Example:

public class ClassName {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}

Don't Worry about the syntax for now. We will learn it in the next few weeks.

2. Compile the code "javac ClassName.java"

  • Compiling a Java program means taking the programmer-readable text in your program file (source code) and converting it to bytecodes.
  • Bytecodes are the instructions that the Java Virtual Machine (JVM) understands.

Example:

The Java compiler is invoked at the command line by typing the command:

javac ClassName.java

3. Run the code "java ClassName"

Running a Java program means executing the bytecodes that were created by the compiler. The Java Virtual Machine (JVM) is the program that executes the bytecodes.