Why Java is platform independent?

Asked by Last Modified  

38 Answers

Learn Java

Follow 0
Answer

Please enter your answer

M-Tech

Once your java code compiled, compiled code(.class) can be executed on any os platform...if your question is HOW..it is interesting which deals with bytecode conversation
Comments

I think your question is "Why Java is called platform independent?"- Java lets you compile source code (written in java) on one platform say Windows and the same compiled code can run on machine with any other platform(be it unix , linux etc) having a JVM running on it. And if your question is - Why...
read more
I think your question is "Why Java is called platform independent?"- Java lets you compile source code (written in java) on one platform say Windows and the same compiled code can run on machine with any other platform(be it unix , linux etc) having a JVM running on it. And if your question is - Why Java is platform independent? Answer - Its the beauty of open source Java , that it does not discriminate between platforms. :) read less
Comments

because java has a own runtime environment it's program is not depend on operating System. c and C++ does not have run time environment ,c & C++ program are Depend for run on OS.
Comments

Java Expert

Previously, most of the programs written in any language have had to be recompiled or rewritten for every other computer platform. Means, you have to either change your code or recompile it when you change the platform (i.e. windows or UNIX or Mac OS etc).JAVA comes with its greatest advantage that you...
read more
Previously, most of the programs written in any language have had to be recompiled or rewritten for every other computer platform. Means, you have to either change your code or recompile it when you change the platform (i.e. windows or UNIX or Mac OS etc).JAVA comes with its greatest advantage that you only have to write and compile your code once. The Java on any platform will interpret the compiled byte code (.class file) into instructions understandable by the particular processor using either interpreter or JIT compiler. JVM uses both the interpreter and JIT compiler. Note: JIT(Just In Time) do not do code compilation but the byte code compilation to platform language (Instruction set) So we can say if we have JVM available for any platform, the onetime compiled code will work on it using the WORA feature of Java i.e. Write Once Run Anywhere. read less
Comments

Because of JVM , JVM can be installed in any Operating system.Write once and execute anywhere(ANY OS) your code.
Comments

Software Developer, Expertise in Java/J2ee Technology.

Java is platform independent, as the java compiled code (byte code) can run on any machine (Operating System) which has JVM in it. Description : JVM is platform dependent, ie JVM for different OS are different. JVM is intermediator, between Java byte code and OS and so, It converts the java byte...
read more
Java is platform independent, as the java compiled code (byte code) can run on any machine (Operating System) which has JVM in it. Description : JVM is platform dependent, ie JVM for different OS are different. JVM is intermediator, between Java byte code and OS and so, It converts the java byte code into executable code for that OS. read less
Comments

One of the major features of java includes that why java is called platform independent language. Before understanding this feature we need to know about -- Javac -- compiler that converts source code to byte code. JVM- interpreter that converts byte code to machine language code. As we know...
read more
One of the major features of java includes that why java is called platform independent language. Before understanding this feature we need to know about – Javac – compiler that converts source code to byte code. JVM- interpreter that converts byte code to machine language code. As we know java is both compiler & interpreter based language. Once the java code also known as source code is compiled, it gets converted to native code known as BYTE CODE which is portable & can be easily executed on all operating systems. Byte code generated is basically represented in hexa decimal format. This format is same on every platform be it Solaris work station or Macintosh, windows or Linux. After compilation, the interpreter reads the generated byte code & translates it according to the host machine. . Byte code is interpreted by Java Virtual Machine which is available with all the operating systems we install. so to port Java programs to a new platform all that is required is to port the interpreter and some of the library routines. Source code -> javac ->Universal byte code Universal byte ->jvm/java -> execute them on a particular machine. Another reason the makes Java a Platform independent language is the elimination of undefined or architecture dependent constructs. Therefore java is called platform independent language. read less
Comments

Technical Trainner.

earlier , maximum programs written in any language have had to be recompiled or rewritten for every other computer platform. Means, you have to either change your code or recompile it when you change the platform (i.e. windows or UNIX or Mac OS etc).JAVA comes with its greatest advantage that you only...
read more
earlier , maximum programs written in any language have had to be recompiled or rewritten for every other computer platform. Means, you have to either change your code or recompile it when you change the platform (i.e. windows or UNIX or Mac OS etc).JAVA comes with its greatest advantage that you only have to write and compile your code once. The Java on any platform will interpret the compiled byte code (.class file) into instructions understandable by the particular processor using either interpreter or JIT compiler. JVM uses both the interpreter and JIT compiler. Note: JIT(Just In Time) do not do code compilation but the byte code compilation to platform language (Instruction set) So we can say if we have JVM available for any platform, the onetime compiled code will work on it using the WORA feature of Java i.e. Write Once Run Anywhere read less
Comments

Computer wizard

because every program gets compiled forming a byte code file that can be interpreted on any platform having JAVA runtime environment JRE.
Comments

awesome

First of all, a platform is anything on which a program is run(in lay man term). A platform is either the machine itself, or a primitive kernel or a fully developed OS. Languages can be platform dependent or independent. Dependent means its executable code and source code varies from platform to platform....
read more
First of all, a platform is anything on which a program is run(in lay man term). A platform is either the machine itself, or a primitive kernel or a fully developed OS. Languages can be platform dependent or independent. Dependent means its executable code and source code varies from platform to platform. That is to say that the programmer has to make some changes in the code if it has to run on other platforms. Languages like C are platform dependent. Platform independent means that the code remains the same irrespective of the platform involved. Java has something called a virtual machine called JVM or Java Virtual Machine. What happens in case of Java is that the JVM once installed on any platform like windows or OS X can run the java code without any alteration. The JVM acts like a virtual platform on which the code is executed. As the platform being JVM remains constant throughout all platforms Java programs can run on any platform irrespective of the real platform. If you want to know the detailed process then it is here: Java source code written in the high level java is first converted to something called the javabyte code. This byte code is not readable by the original platform, but only the JVM can read it and then it executes it. This is the primary reason why Java is much in use even today. read less
Comments

View 36 more Answers

Related Questions

Is Java a pure object-oriented programming language?
Java is often considered to be a "pure" object-oriented programming (OOP) language because it follows many principles of OOP. However, it does have some features that deviate from strict purity. For example,...
Shiv
0 0
5
Is learning Java worthwhile?
Yes, learning Java is worthwhile for versatile career opportunities in web, mobile, and enterprise development.
Shantanu
0 0
5
Why do many software engineers not like Java?
Opinions on programming languages can vary, but some software engineers may express dissatisfaction with Java for reasons such as perceived verbosity, boilerplate code, and a slower pace of language evolution...
Guruprasad
0 0
5

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Java : Compile-time Versus Runtime optimization
While designing and development, one should think in terms of compile-time and run-time.It helps in understanding language basics in a better way.Let's understand this with a question below : What...
S

Hibernate 5
The Hibernate team published the first Hibernate 5 release quite a while ago, and since then they introduced a bunch of new features. I explained several of them here on the blog, and it’s about...
M

Mohammed Shahnawaz Akhter

2 0
0

Importance of Constructor's Visibility.
While developing program or implementing Singleton pattern we have learnt to mention constructor as private and known reason is -> to blocked its direct call from outside of class. But did we think...

2.1. Reverse a singly linked list.
class Node { int data; Node next; Node(int data) { this.data = data; this.next = null; }} public class LinkedList { Node head; public void reverse() { Node prev = null; Node curr = head; Node next =...

Java Training Syllabus
Learn JAVA-J2EE Syllabus Core Java - Syllabus aligned to OCA Exam - JDK 8 Object-Oriented Programming (OOPS) concepts: Programming Languages Object Oriented Programming Classes & Objects Pillars...

Recommended Articles

Before we start on the importance of learning JavaScript, let’s start with a short introduction on the topic. JavaScript is the most popular programming language in the world, precisely it is the language - for Computers, the Web, Servers, Smart Phone, Laptops, Mobiles, Tablets and more. And if you are a beginner or planning...

Read full article >

In the domain of Information Technology, there is always a lot to learn and implement. However, some technologies have a relatively higher demand than the rest of the others. So here are some popular IT courses for the present and upcoming future: Cloud Computing Cloud Computing is a computing technique which is used...

Read full article >

Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...

Read full article >

Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to “write once, run anywhere” (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...

Read full article >

Looking for Java Training Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you