1.

Why Java Is Platform Independent? Explain. ?

Answer»

When you write and COMPILE a Java applet, you end up with a platform-independent FILE called a bytecode. Like a standard program, a bytecode consists of ones and zeros. Unlike a standard program, however, the bytecode is not processor specific. In other words, the bytecode does not correspond to an Intel Pentium or a Motorola processor. Instead, after the server DOWNLOADS the bytecode to your browser, special code within the browser reads and interprets the bytecode, in turn running the applet. To run the bytecode in this way, the interpreter translates the platform independent ones and zeros into ones and zeros your computer's processor understands. In other words, it maps the bytecode to ones and zeros that correspond to the current processor, such as a Pentium.
Each computer platform (Mac, Windows, and so on) can have its own Java interpreter. However, the bytecode file that the server downloads to each browser is identical. In this way, you use the same bytecode on a browser running on a Mac, a PC, or a Silicon Graphics workstation. The multi-platform bytecode file is just one aspect of Java's portability. Java's designers also took the EXTRA EFFORT to remove any platform dependence in the Java language. Thus, you will not find any hardware specific references in Java.

When you write and compile a Java applet, you end up with a platform-independent file called a bytecode. Like a standard program, a bytecode consists of ones and zeros. Unlike a standard program, however, the bytecode is not processor specific. In other words, the bytecode does not correspond to an Intel Pentium or a Motorola processor. Instead, after the server downloads the bytecode to your browser, special code within the browser reads and interprets the bytecode, in turn running the applet. To run the bytecode in this way, the interpreter translates the platform independent ones and zeros into ones and zeros your computer's processor understands. In other words, it maps the bytecode to ones and zeros that correspond to the current processor, such as a Pentium.
Each computer platform (Mac, Windows, and so on) can have its own Java interpreter. However, the bytecode file that the server downloads to each browser is identical. In this way, you use the same bytecode on a browser running on a Mac, a PC, or a Silicon Graphics workstation. The multi-platform bytecode file is just one aspect of Java's portability. Java's designers also took the extra effort to remove any platform dependence in the Java language. Thus, you will not find any hardware specific references in Java.



Discussion

No Comment Found