Why java is platform independent?


This is one of the important interview questions for the Freshers, we all know that C and C++languages are platform dependent languages whereas Java is a platform independent language

Before going to know about this we have to know that what is platform dependent and independent

If any coding language which allows its applications to compile and execute in the same operating system then we called as platform dependent. 

                          Ex: CC++ 

If any coding language which allows its applications to compile and execute in the same operating system as well as other operating system. Then we called as platform independent. 

                         Ex: Java 

Note: JVM is not platform independent. While installing JDK only jvm also installed automatically. When you compile your code, then Java compiler is the responsibility to generate the. class file, this .class file code will be read by the JVM. Here the one important point is that every operating system will have its own JVM and this JVM makes the Java platform independent.

No comments:

Post a Comment

What is Normalization?

Database normalization is a data design and organization process applied to data structures based on rules that help building relational dat...