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

Can we print any string in Java without a semicolon?
Yes We can print a string with out semicolon in if statement. public class Print_Without_Semicolon { public static void main(String args) { int i = 0; if(System.out.printf("print...
Sridevi
0 0
6
What is the use of package in JAVA?
Have you ever observed why we all are having kitchen / hall / bedroom or any? Have you ever observed why most of the bags contains zips and folders ? Have you ever observed why people create different...
Pushpendra
What is the best site to learn Java for development?
www.javatpoint.com Is best site to learn and earn knowledge
Chai
0 0
8

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

Ask a Question

Related Lessons

Amazon written test for experience
For the below written test answer I defined with "*" at the end of the options NULL is the same as 0 for integer the same as blank for character * the same as 0 for integer and blank for character the...

JAVA Version History
Java Version History: There are many java versions that has been released. Current stable release of Java is Java SE 8. JDK Alpha and Beta (1995). JDK 1.0 (23rd Jan, 1996). JDK 1.1 (19th Feb, 1997). J2SE...

Difference Of Inheritance In C++ And Java
In Java , multiple inheritance is not applicable directly but we can implement the concept by using the interfaces. In c++ and Java, the common types of inheritances are: Single Multi level Hybrid Hierarchical

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

Demand of java in industry
Java is one of the widest use language in the industry all around the world As in software market more than 80% software, platform developed using java. Java comes in three flavours:- j2se for window based...

Prashant Tomer

0 0
0

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