The invention of machine is probably the greatest achievement in our civilization. We no longer have to do all the works by ourselves, instead, we can simply just order the machines to do it. It greatly improve our productivity as a whole.
This is where computer programming comes into play. One can think of computer programming as instructions he gives for the machine to follow. In our current technological stage, machines are stupid, they don’t think, they do exactly what you tell it to do. As a programmer, you can program in so many instructions that the computer appears to be able to think and make decision by itself, we call this Artificial Intelligence (AI). But remember, it is still following the commands you set in the command files. This is one important point to consider when programming, and don’t assume the computer knows what you want it to do.
Enough of the Computer Science theory, let’s cut to the chase.
So what is Java? Java Beans? Coffee? No, that’s … go drink some tea.
Java is a programming language developed by Sun Microsystems. It is an Object Oriented Programming Language derived from the popular C++. The syntax are very similar between the two, so it is easy for one to learn Java, then jump to C++ later. Programming languages are just like real languages, after you learned on, learning another is easier.
So why Java? Well, let’s say that Java is an evolving language. When you build the java codes, it don’t remain the same like C++ applications. As our technologies advance, the program you wrote also advance with it. So in simple terms, a program you wrote in Java now will run much faster after 5 years. On the other hand, C++ programs you wrote remain the same no matter what. This is because in Java, there’s a middle man call the Java Virtual Machine.
Generally, the programming progress follow the trend shown below:
Programming Language that we write actually make no sense what so ever to the computer, since they only operate on binary, 1 and 0. That’s why we need a compiler to convert the codes we write into something that the machine understand and run, aka Machine Codes.
Java, on the other hand, follows a similar but different process.
In Java, after the source codes went through the compiler, it generate codes that can be ran by the Java Virtual Machine. As I mention earlier, the Virtual Machine is like a middleman. It contains a lot of standard library files that get refer to by the computer. So basically, the Virtual Machine serve as a bridge that allow the code to run on different platforms. Not only can you program desktop application for your PC, but you can also write programs that run directly off the internet, programs that run on your phone… you can think of the virtual machine as a “global simulator”, just like how you can play Playstation games on your PC.
The Java Virtual Machine, along with the set of libraries that it operate on made up the Java Runtime Environment (JRE). Installation of JRE is necessary in order to run any Java programs. Since most devices nowadays are Java enabled, they are pre-installed for you by the manufacturer. When you get updates for the JRE, that’s when your Java application evolve, because the Java Virtual Machine or the Library get updated, and that affect the way your program runs.
So now we have a basic understanding of how Java operates, we will dive into writing our first program!