How java is platform independent?

Answer Posted / santosh sahu

When you write the program for any programming language it
is called (source program), and it will have the extension
depending upon the language. For example, the C language
will have the extension ".c" and ".cpp" in C++.
When you compile the file or (source program), you will get
the ".exe" extension. This ".exe" file is executed by the
operating system in the C & C++ program.
If you are writing the program and compile it in one
operating system, you cannot take the same ".exe" file to
another operating system for extension. That means, this
program depends upon the operating system for its execution.

In Java, when you write the program, you will have
the ".java" file. And when it is compiled, you will get
the ".class" file. The ".class" file is executed by the
Java Virtual Machine (JVM). If you have the JVM, you can
execute the java program anywhere under operating system.
That means, that Java is PLATFORM INDEPENDENT.

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which package has light weight components?

568


Discuss 2D arrays.

612


What are the 2 types of java programs?

567


How many digits can a float hold?

539


What are the different types of inheritance in java?

537






What are the topics in advance java?

525


Explain wait(), notify() and notifyall() methods of object class ?

605


What is thread life cycle in java?

586


How do you remove an element from an arraylist in java?

464


What about instanceof operator in java?

603


What are the six ways to use this keyword?

614


What are the disadvantages of object oriented programming?

603


How to avoid memory leak in java?

602


give an example for encapsulation?

586


Can a static member function access member variable of an object?

564