Java Technology is a programming language as well as a platform.
Java as a programming language: It is a high level programming language which has many good characteristics like simple, object oriented, distributed, multi-threaded, dynamic, architecture neutral, portable, high performance, robust and secure.
Java as a platform: A platform means the hardware or software environment in which program can run. As we know Windows, Linux and other operating systems are the platforms that are the combination of hardware and software. But Java is the software-only platform on the top of the other hardware based platforms like all the operating system. Following diagram depicts the same.
Moreover, Java platform has two main components:
- The Java Virtual Machine
- The Java Application Programming Interface (API)
The Java Virtual Machine is kind of a virtual machine which is installed on the top of the operating system. JVM is platform dependent as each operating system has its own JVM, which has the ability to understand and communicate with its own underlying operating system.
The Java Application Programming Interface (API) is the collection of the ready-made software components. It provides many useful capabilities and functionality. It is a kind of libraries which consists of classes and interfaces. These libraries are also known as packages. To use any kind of existing functionality, we just need to call specific method and we do not need to care about the implementation of that particular method.
Question: Is JVM a platform independent?
Answer: No, JVM itself is not platform independent as different JVM is designed for different Operating System. Java language is platform independent as we can write a Java code on one machine and run it on another machine.