Q) What are the features of java makes it distinct from other conventional programming language ? How is it possible ? What is its benefit ?
A)
1) Java applications are platform independent (architectural neutral).
2) That means, if we develop and compile a java application in one operating system (os) environment, the resultant file (class file) can be executed in any other os environment. This is nothing but platform independency.
“Operating system + hardware (processor) = platform “
Java programs os independent.
Os is considered as “real machines”.
Ex: windows machine, linux machine, mac machine.
Same source code compiles & run at any environment with zero modifications or less modifications that is called portability.
Ex: java programs.
After compile over the resultant file run at any other environment. That is called platform independent.
Ex: java
The c and c++ programs in which os the file is compiled that exe file is understand by that processor only not understand by other processor. That’s why they are not platform independent. So, the c and c++ are not portable.
Java programs don’t run directly on os. Therefore java applications are os independent.
Two things contribute to the os independency of java applications.
1) Class file
2) os dependent JVM(java virtual machine)
1) Class file
2) os dependent JVM(java virtual machine)
If we compile java programs in any os that produce same class file.
If we compile a java application in any os environment we get same class file(s).
When compile c or c++ that produce exe file that contain instructions to that particular os only. So that is os dependent.
A class file contains byte code. Byte code contains instructions understandable to any kind of JVM.JVMs are many kinds.
JVMs are os dependent.
JVM :
JVM is a special software that provides execution environment for java programs main goal of JVM is to execute java applications.
JVMs are os dependent.
Ex : JVM for windows different.
JVM for unix different.
JVM converts byte code into underlying os understandable machine instructions to be given to the process. JVM is a translator.
For java programs real machine is not provide execution environment. The JVM only provide the execution environment for conventional program.
If an application is os independent developers need not be thinking about os specific functionality and as all the users can use it. More market and hence at cheaper price software can be produced.
Comments
Post a Comment