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 are the important features of Java 11 release?

807


What is the exception hierarchy in java?

741


Can anonymous class have constructor?

798


What is the file extension for java?

857


What is a percentage sign called?

832


What are streams?

863


How will you calculate the depth of a binary tree if the tree contains 15 nodes?

850


Explain the difference between hashmap and hashtable in java?

725


What’s the difference between constructors and other methods?

764


Why set do not allow duplicates in java?

781


What is difference between adapter class and listener?

720


What is parse method?

769


What are three ways in which a thread can enter the waiting state in java programming?

922


What does  mean in regex?

784


What is an i/o filter?

1234