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 if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?

937


What is string buffer?

717


What are different types of encoding?

824


What is the difference between the boolean & operator and the && operator in java programming?

769


How do you sort in descending order in java using collections sort?

709


What do you mean by composition in java?

776


Why stringbuffer is faster than string?

780


What does percent mean in java?

793


How can we achieve thread safety in java?

899


What are the important features of Java 11 release?

785


Explain enumeration in java?

775


How to perform binary search in java?

780


Which types of exceptions are caught at compile time?

778


What is derived datatype?

880


How to print nodes of a Binary tree?

2002