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

What is the length of a string?

528


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

697


What is static in java?

561


What is printwriter in java?

522


What is the purpose of the enableevents() method?

587






What do you know about java?

527


Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?

1030


Is sizeof a preprocessor?

546


What is the use of generics? When was it added to the Java development Kit?

560


From the two, which would be easier to write: synchronization code for ten threads or two threads?

619


Explain the init method?

546


What is lexicographically smallest string?

607


What is the difference between post and put?

538


What is the synchronized method modifier?

596


how are methods defined?

555