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

What is a complete list of topics of Core Java and topics of Advanced Java?
Certainly! Here's a brief list of topics for both Core Java and Advanced Java: Core Java: Basics of Java Data Types and Variables Control Flow (if, else, switch) Loops (for, while, do-while) Arrays Methods Object-Oriented...
Archit
0 0
5
Why does â??5/2 = 2â?? and not 2.5 in Python?
Due to dynamic Typing. use Numpy , and declare data type , you will get desired result
Srikanth
0 0
6
What is the purpose of using throws keyword in java?
The throws statement is how you create an exception stack trace. There isn't much magic in java--it's not some underlying system mystery that creates an exception, it is simply a "Throw" statement, and...
Saritha
What is the general syllabus covered in core Java training from any institution?
Welcome Course Overview Review of Java Fundamentals The Java Environment Data Types The String Class The StringBuffer Class Arrays Passing Data Types to a Method Constructors &...
Shiv Kohli
0 0
5
Sir tell me some tips to code in java?
If you know C / C++ already, just try how will you able to achieve same examples in java. I prefer try to understand the fundamental of java and create small programs, then make the connectivity among them. Slowly build an application.
Nitinkumar

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

Ask a Question

Related Lessons

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 =...

How do i get best Campus / Off Campus Placement?
Companies are looking for Skilled Freshers. So build your technical skills while doing MCA / BTech / BCA / BSc (IT or CS) into below areas- 1. Strong your programming & debugging skills ...

Class and Objects in Java
Class is a template or a blueprint which is used to describe an object. On other hand Object is a reference of a class which follows all the stuff written inside the class. How about taking the whole tour in the following video

Tips of learning Java Language/Other Programming Languages
1.You should know the basic concept: If we talk about programming languages so basic concept are same in all the high level languages. So you should know the basic concept firstly then you can easily understand...
I

ICreative Solution

0 0
0

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