How java is platform independent?

Answer Posted / invisible

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 ?    191 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how does multithreading take place on a computer with a single cpu? : Java thread

907


How is hashcode calculated in java?

710


Why for each loop is used?

742


What are generic methods?

730


Why is string builder not thread safe?

832


How do you remove all elements from an arraylist in java?

725


What is split return?

689


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

712


Name some classes present in java.util.regex package.

800


What is better- service oriented or batch oriented solutions?

1872


Differentiate between overriding and overloading cases?

794


What is the largest data type in java?

723


Why null value is used in string?

762


What is the different between get and post?

718


What is main string [] args?

736