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

What is java abstraction with example?

552


What is the purpose of using break in each case of switch statement?

559


How are destructors defined in java?

569


Where is jre installed?

585


How to stop a thread in java? Explain about sleep () method in a thread?

578






Is space a string in java?

508


Is integer passed by reference in java?

560


Which one of the following suits the description of a string better: derived or primitive?

510


Can we create more than one object singleton class?

575


What is == mean?

547


What is hash in java?

515


What is the right data type to represent a price in java?

564


What is void keyword?

664


what do you mean by classloader?

549


Explain the meaning of java applet.

602