Java Virtual Machine (JVM)

In this tutorial you will learn about the Java Virtual Machine (JVM) and its application with practical example.

What Is Java Virtual Machine (JVM)

Acronym JVM stands for Java Virtual Machine. JVM is an abstract computing machine or virtual machine inside the computer, JVM provides a platform-independent execution environment for the java program that converts Java bytecode into machine language and executes it.

how-java-program-works

Many other programming languages including C and C++, compile source code directly into machine code that is designed to run on a specific microprocessor architecture or operating systems, such as Windows or UNIX, while a JVM is a computer within a computer that mimics a real Java processor, enabling Java bytecode to be executed as actions or operating system calls on any processor regardless of the operating system. For example, establishing a socket connection from a workstation to a remote machine involves an operating system call. Since different operating systems handle sockets in different ways, the JVM translates the programming code so that the two machines that may be on different platforms are able to connect.

The JVM performs four main tasks –

Loads code

Verifies code

Executes code

Provides run-time environment

In this tutorial we have learn about the Java Virtual Machine (JVM) and its application with practical example. I hope you will like this tutorial.