How java is platform independent?

Answer Posted / karthik

When Java Code is compiled a byte code is generated which is
independent of the system. This byte code is fed to the JVM
(Java Virtual Machine) which resides in the system. Since
every system has its own JVM, it doesn't matter where you
compile the source code. The byte code generated by the
compiler can be interpreted by any JVM of any machine. Hence
it is called Platform independent Language.

Java's bytecodes are desgined to be read and interpreted in
exactly same manner on any computer hardware or operating
system that supports Java Runtime Environment.

The Java Virtual Machine can be called a virtual operating
system that enables a java programme to run... we are thus
calling java platform independent because a java program
will not give different outputs on different machines but
platform dependent programmes tend to give different results
when compiled on different machines...

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are local variables?

599


What is the difference between private & public & friendly classes?

556


Why is it important to initialize a variable?

502


Is minecraft java edition free?

584


What is a Presistent Object?

649






Can we define private and protected modifiers for variables in interfaces?

589


What are the three best choices for a development environment?

619


How to overcome the exception object reference not set to an instance of object?

630


How do you break a loop?

568


can java object be locked down for exclusive use by a given thread? : Java thread

538


What does .equals do in java?

533


What is oop in java?

535


What is the tradeoff between using an unordered array versus an ordered array?

673


Why hashset is used in java?

540


What's the purpose of static methods and static variables?

602