You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/java-basic/2023-11-04-java-platform-independant.md
+10-13
Original file line number
Diff line number
Diff line change
@@ -5,20 +5,20 @@ author: gaurav
5
5
categories: [ Java, Core Java ]
6
6
featured: false
7
7
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."
9
9
```
10
10
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.
12
12
13
13
## Introduction
14
14
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.
16
16
17
-
But In practicality their are some limitations to it. Some programming languages are platformdependent 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.
18
18
19
19
But Java is an exception to it.
20
20
21
-
> Java is a platformindependent programming language.
21
+
> Java is a platform-independent programming language.
22
22
>
23
23
> Java achieves platform independence with the help of **bytecode** and **Java Virtual Machine**.
24
24
@@ -30,13 +30,13 @@ If a code written on one platform can run on any other platform, then it is plat
30
30
31
31
In Java programming language a program written on a platform can be run on any other platform, provided a JVM is installed.
32
32
33
-
So, in java we can **Write Once Run Anywhere (WORA)**.
33
+
So, in Java we can **Write Once Run Anywhere (WORA)**.
34
34
35
35
## How Java Achieves Platform Independence?
36
36
37
37
When a developer writes a program it is in human readable format. i.e. `.java` file.
38
38
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.
40
40
41
41
Then J**ava Virtual Machine** (JVM) executes the bytecode. At the end, we can see the output of the program.
42
42
@@ -53,9 +53,6 @@ public class HelloWorld {
53
53

54
54
55
55
## 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