Introduction To Java
Java was developed by 5 scientists, lead by James Gosling, in the year 1991.
It was initially known as ‘Oak’ and later renamed as Java.
Java was initially developed with one basic intention in mind - Make programs Platform Independent.
This feature of Java has always been the strongest suit of the language despite its various other noticable advantages.
Working of Java Compiler
If you understood how Java program is compiled and run on a machine,you will be clear what Platform-Independent basically means.
First you write a Java program in an Editor or an IDE. This written program is called the Source Code. You do not have to worry how to write a source code, I am there for that ☺.
The Source Code is then compiled using the javac(Java Compiler).
After compiling,a file is generated. This file is called the ByteCode. It has an extension of .class. The ByteCode is platform-independent.
The ByteCode is then interpreted by the Java Virtual Machine(JVM) to make the computer understand the complied code.(You know your computer is dull enough,coz the only thing it understands is machine language which is basically comprised of 0's and 1's) The JVM is NOT platform-independent.
The takeaway would be that you can take your ByteCode(.class file) and throw it at a JVM for a particular Operating System. It would be happy to run the code for you. The JVM varies for different platform(basically means Operating System).
If you are crystal clear with the above knowledge, you are good to go for some real code in Java programming.