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's a method in programming?

756


Why is string class considered immutable?

814


Is it necessary that each try block must be followed by a catch block?

787


What is use of inner class in java?

755


What is a string token?

726


Write a java program to count the number of words present in a string?

730


Which package is always imported by default?

782


What are the two ways of implementing multi-threading in java?

1157


What is the difference between a static and a non-static inner class in java programming?

730


What is difference between printf and scanf?

738


Why can't you declare a class as protected?

805


What is codebase?

760


What are basic keywords?

799


What are the advantages and disadvantages of reference counting in garbage collection?

779


What is a singleton in genetics?

806