What is Java Platform? Ultimate Guide for Programmers
What is Java?
What is Java?
Java is a programming language and a computing platform for application development. It was first released by Sun Microsystem in 1995 and later acquired by Oracle Corporation. It is one of the most used programming languages.
What is Java Platform?
Java platform is a collection of programs that help to develop and run programs written in the Java programming language. Java platform includes an execution engine, a compiler, and a set of libraries. JAVA is platform-independent language. It is not specific to any processor or operating system.
This video introduces the Java platform, and explains why Java is a platform as well as a programming language.
To understand JAVA programming language, we need to understand some basic concept of how a computer program can run a command and execute the action.
What is PC?
A computer is an electronic device capable of performing computations, and we all know that it is composed of a monitor, keyboard, mouse, and memory to store information. But the most important component of the computer is a PROCESSOR. Which does all thinking of computer, but the question is how the computer does this thinking? How does it understand text, images, videos, etc.?
What is Assembly Language?
The computer is an electronic device, and it can only understand electronic signals or binary signals. For example, the 5-volt electronic signal may represent binary number 1 while 0 volts may represent binary number 0. So your PC is continuously bombarded with these signals.
Eight bits of such signals are group together to interpret Text, numerical and symbols.
For example, the # symbol is identified by computer as 10101010. Similarly, the pattern for adding a function is represented by 10000011.
This is known as 8-bit computing. Current day processor is capable of decoding 64-bit time. But what is the relation of this concept with the programming language JAVA? Let understand these as an example.
Suppose if you want to tell the computer to add two number (1+2) which is represented by some binary numbers (10000011), how are you going to tell the computer? Yes, we going to use assembly language to get our code executed.
That apart, you will also have to make calls to create Operating System provided functions to display the output of the code.
But alone assembler is not involved in this whole process; it also requires the compiler to compile the long code into a small chunk of codes. With advancement in software development languages, this entire assembly code could shrink into just one line print f 1+2 A with the help of software called COMPILER. It is used to convert your c language code into assembly code, and the assembler converts it into corresponding machine code, and this machine code will be transmitted to the processor. The most common processor used in PC or Computers are Intel processor.
Though present-day compilers come bundled with assembler can directly convert your higher language code into machine code.
Now, suppose Windows operating system is running on this Intel processor, a combination of Operating System plus the processor is called the PLATFORM. The most common platform in the world is the Windows, and Intel called the Wintel Platform. The other popular platforms are AMD and Linux, Power PC, and Mac OS X.
Now, with a change in processor, the assembly instructions will also change. For example the
By using Java Virtual Machine, this problem can be solved. But how it works on different processors and O.S. Let’s understand this process step by step.
Step 1) The code to display addition of two numbers is System.out.println(1+2), and saved as .java file.
Step 2) Using the java compiler the code is converted into an intermediate code called the bytecode. The output is a .class file.
Step 3) This code is not understood by any platform, but only a virtual platform called the Java Virtual Machine.
Step 4) This Virtual Machine resides in the RAM of your operating system. When the Virtual Machine is fed with this bytecode, it identifies the platform it is working on and converts the bytecode into the native machine code.
In fact, while working on your PC or browsing the web whenever you see either of these icons be assured the java virtual machine is loaded into your RAM. But what makes java lucrative is that code once compiled can run not only on all PC platforms but also mobiles or other electronic gadgets supporting java.