Register on the forum now to remove ALL ads + popups + get access to tons of hidden content for members only!

Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > Java


Thread Tools Rate Thread Display Modes
Old 06-19-2018, 05:18 AM   #1
Registered User
Join Date: May 2018
Posts: 8
How is Java platform independent?

The meaning of platform independent is that, the java source code can run on all operating systems. A program is written in a language which is a human readable language. It may contain words, phrases etc which the machine does not understand. For the source code to be understood by the machine, it needs to be in a language understood by machines, typically a machine-level language. So, here comes the role of a compiler. The compiler converts the high-level language (human language) into a format understood by the machines. Therefore, a compiler is a program that translates the source code for another program from a programming language into executable code. This executable code may be a sequence of machine instructions that can be executed by the CPU directly, or it may be an intermediate representation that is interpreted by a virtual machine. This intermediate representation in Java is the Java Byte Code.

Step by step Execution of Java Program:

1. Whenever, a program is written in JAVA, the javac compiles it.

2. The result of the JAVA compiler is the .class file or the bytecode and not the machine native code (unlike C compiler).

3. The bytecode generated is a non-executable code and needs an interpreter to execute on a machine. This interpreter is the JVM and thus the Bytecode is executed by the JVM.

4.And finally program runs to give the desired output.

Besant Technologies Provide best Java Training in chennai
vimal18kumar03 is offline   Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Are Jvm's Platform Independent? sunled Java 0 06-06-2018 01:53 AM
What is the main difference between Java platform and other platforms? ajaxdns Java 0 05-29-2018 07:02 AM
What is the main difference between Java platform and other platforms? sunled Java 0 04-12-2018 09:41 PM
What is the main difference between Java platform and other platforms? sunled Java 0 11-16-2017 01:23 AM
Java is a platform independent language. BarryWillson Java 4 04-18-2016 12:03 AM

All times are GMT -7. The time now is 06:27 AM.

Powered by vBulletin Copyright © 2013 vBulletin Solutions, Inc.