Well here it goes. It has been years since I have programmed anything. I do dabble in scripts but to jump back into an actual computer programming language not so much. So here I will post my trials and tribulations on the road to re-learning how to program all over again. First things first.

What is Java?

A nice hot beverage… Well yes but not what I am looking for. Java is a high-level programming language that runs on any Operating System. Java unlike other high programming languages uses its own environment inside a Java Virtual Machine (JVM) to run code. You see other languages translate the code entered by a programmer by a compiler and interpreted into machine language which is then executed by the OS itself. Not Java. Java uses the JVM which is an abstract machine on top of the OS, the Java code is interpreted on the JVM and executed in its own environment.

So lets do a quick run down on the execution of the a Java code using the classic program Hello World.

1. Programmer writes to java code.

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

2. The code is compiled using javac.

Joels-MacBook-Pro:java joelrivera$ javac HelloWorld.java 

3. The compiler generates a Java class file.

4. Shown in the example below the execution of Hello World by calling the Java JVM to execute to compiled code.

Leave a Reply