Why Java is a platform independent language?

Answer Posted / ashwani maddeshiya

This is because of the magic of Byte Code which is OS indepedent. When java compiler compile any code then it generate the byte code not the machine native code(unlike C compiler).Now this byte code need a interpreter to execute on a machine.This interpreter is JVM.So JVM read that byte code(that is machine indepedent) amd execute it. Different JVM is designed for different OS and byte code is able to run on different OS.

Is This Answer Correct ?    12 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the relationship difference the canvas class and the graphics class?

547


What is abstract class constructor called?

550


What is keyword auto for?

627


Can Exception handling we can handle multiple catch blocks?

631


Explain the difference between private, public, package and protected in java?

583






What is better - 'bit-shift a value' or 'multiply by 2'?

681


what is meant by HQL?

631


How the metacharacters are different from the ordinary characters?

546


How arrays are stored in memory in java?

496


What are drawbacks of singleton class?

510


What is the difference between procedural and object-oriented programs?

514


Can we make main() thread as daemon?

564


Why do we need data structure in java?

554


What is compareto?

525


How do you start a thread?

532