Java is a programming language which is widely used on countless devices. This programming language became very popular because of the concept of writing once and run anywhere.
Traditional programming language such as C, C++ and Pascal are platform dependent which means that if you write and compile the source code in windows, it must and will run only on windows. Imagine how many derivate of Microsoft Windows we already have including the 32 bit and 64 bit version. And lets add up the different flavors of UNIX that we have to take into account. So if we have n number of operating systems that we want our program to be compatible, then we also need to have n version of our program.
The platform dependency of earlier computer programs was solved by Java. Java runs through a virtual machine. It’s an interpreted programming language. Therefore, regardless of which platform you have developed and compiled your code, it is expected that it should run on any compatible JVM regardless of which operating system it sits in. This concept became a reality through bytecode encoding. When you compile your Java code, it is translated into bytecode. The Java virtual machine (JVM) will then interpret the bytecode and translate it into machine language. Simple and a lot faster in development isn’t it?
Java maybe great in terms of portability, however there is one big drawback which is its computer resource intensiveness. Because Java runs inside of another program which is the JVM, it is more resource intensive than those traditional programming languages. But because of ease of deployment, faster development and the availability of more powerful server, it outweighs the mentioned disadvantages.