Why Java is Platform Independent?

preview_player
Показать описание
There are two steps required to run any java program i.e.
(i) Compilation &
(ii) Interpretation Steps.

Java compiler, which is commonly known as Javac is used to compile any java file. During compilation process, java compiler will compile each & every statement of java file. If the java program contains any error then it will generate error message on the Output screen. On successful completion of compilation process compiler will create a new file which is known as Class File / Binary Coded File / Byte Code File / Magic Code File.

Generated class file is a binary file therefore java interpreter commonly known as Java is required to interpret each & every statement of class file. After the successful completion of interpretation process, machine will generate Output on the Output screen.

This generated class file is a binary coded file which is depends on the components provided by java interpreter (java) & does not depends on the tools & components available in operating system.

Therefore, we can run java program in any type of operating system provided java interpreter should be available in operating system. Hence, Java language is known as platform independent language.

- Aatul Palandurkar

#JavaTrainingInPune #CoreJavaTrainingInPune #JavaTrainingInWakad #JavaTrainingInHinjewadi #JavaTrainingInChinchwad #JavaTrainingInDangeChowk #JavaProject #CoreJavaProject #J2EEProject #SummerInternshipOnJava #WinterInternshipOnJava
Рекомендации по теме
Комментарии
Автор

Your comment is 5 months old, but I would like to answer you question if it has not already been answered. What Atul did not mention was that Java gets compiled into Java Byte code. The reason why Java is platform independent is that the JVM can be written in virtually any programming language. Just as long as they can interpret JavaByte code. Another thing, speed is based on the programmer. High level C and Assembly can get blotted down by compilers. Same with Java. Depends on the optimization.

KhalilEstell