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
What is singleton class example?
What are different types of control structures?
Can we define private and protected modifiers for variables in interfaces?
What is the importance of hashcode() and equals() methods?
What does the “static” keyword mean? Can you override private or static method in java?
What is java and why do we need it? Explain
What type of variable is error flag?
Can we use both this () and super () in a constructor?
Why you should not use singleton?
What is exception hierarchy in java?
How many bytes is a string java?
What is the difference between Java1.4 and Java1.5
Difference between object instantiation and construction ?
What is the meaning of course?
What do you understand by overloading and overriding in java?