Skip to content

Commit 8fcaa7e

Browse files
authored
Update 2023-11-04-java-platform-independant.md
1 parent 9b75633 commit 8fcaa7e

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

‎_posts/java-basic/2023-11-04-java-platform-independant.md

+10-13
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ author: gaurav
55
categories: [ Java, Core Java ]
66
featured: false
77
toc: true
8-
description: "In this article, we will learn about the Java's platform independancy and how java achieves it."
8+
description: "In this article, we will learn about Java's platform independence and how Java achieves it."
99
```
1010

11-
In this article, we will learn about the Java's platform independency and how java achieves it.
11+
In this article, we will learn about Java's platform independence and how Java achieves it.
1212

1313
## Introduction
1414

15-
A software programs are very specific to the hardware and operation systems it is written on. When we write a piece of code on a platform, it will compile and run on that sample platform. But for the diversity and portability of the code or software it is important that it should run on other platforms too.
15+
The software programs are very specific to the hardware and operation systems it is written on. When we write a piece of code on a platform, it will compile and run on that sample platform. But for the diversity and portability of the code or software, it is important that it should run on other platforms too.
1616

17-
But In practicality their are some limitations to it. Some programming languages are platform dependent that means the code written on the a platform can run on that platform only. For example C.
17+
But In practicality, there are some limitations to it. Some programming languages are platform-dependent which means the code written on the platform can run on that platform only. For example C.
1818

1919
But Java is an exception to it.
2020

21-
> Java is a platform independent programming language.
21+
> Java is a platform-independent programming language.
2222
>
2323
> Java achieves platform independence with the help of **bytecode** and **Java Virtual Machine**.
2424
@@ -30,13 +30,13 @@ If a code written on one platform can run on any other platform, then it is plat
3030

3131
In Java programming language a program written on a platform can be run on any other platform, provided a JVM is installed.
3232

33-
So, in java we can **Write Once Run Anywhere (WORA)**.
33+
So, in Java we can **Write Once Run Anywhere (WORA)**.
3434

3535
## How Java Achieves Platform Independence?
3636

3737
When a developer writes a program it is in human readable format. i.e. `.java` file.
3838

39-
When we compile it, the java compiler converts it to the **bytecode**. i.e. `.class` file. Bytecode is not a native code for machine. It can be understood by JVMs only.
39+
When we compile it, the Java compiler converts it to the **bytecode**. i.e. `.class` file. Bytecode is not a native code for a machine. It can be understood by JVMs only.
4040

4141
Then J**ava Virtual Machine** (JVM) executes the bytecode. At the end, we can see the output of the program.
4242

@@ -53,9 +53,6 @@ public class HelloWorld {
5353
![An image showing How Java Achieves Platform Independance.](J:\code\repos\coderolls-blog\assets\images\2023-11-02\java-platform-independent.png)
5454

5555
## Conclusion
56-
57-
Java Programming language is a platform independent. We can **Write Once Run Anywhere (WORA)**.
58-
59-
Java Virtual Machine (JVM) is not platform independent. Different Operating systems have different types of executable instructions. So there are different JVMs for different OS.
60-
61-
All JVMs can understand the bytecode and converts it to respective executable instructions. This makes Java a platform independent language.
56+
1. Java Programming language is a platform independent. We can **Write Once Run Anywhere (WORA)**.
57+
2. Java Virtual Machine (JVM) is not platform-independent. Different Operating systems have different types of executable instructions. So there are different JVMs for different OS.
58+
3. All JVMs can understand the bytecode and convert it to respective executable instructions. This makes Java a platform-independent language.

0 commit comments

Comments
 (0)