Java - Platform Independence
Java - Platform Independence
Cross-platform software
cross-platform, or multi-platform, is an attribute conferred to computer software or computing methods and concepts
that are implemented and inter-operate on multiple computer platforms
1. One requires individual building or compilation for each platform that it supports,
2. And the other one can be directly run on any platform without special preparation, e.g., software written in an
interpreted language or pre-compiled portable byte code for which the interpreters or run-time packages are
common or standard components of all platforms.
A Multi-platform or cross-platform software: software is available on more than one platforms (operating
systems). This could mean two things -
1. The software is provided with different builds / applications for different platforms [different packages for
windows, this one for linux].
2. The software can be run (with the same download) on multiple platforms but NOT all.
Platform Independent
Software that is platform independent does not rely on any special features of any single platform, or, if it does,
handles those special features such that it can deal with multiple platforms.
Platform Independent software : Platform independent software in its strict sense means –
Install anywhere and run everywhere – it doesnt matter where you are. Although you may get different
installers (for different platforms), this would be just for users ease. There would be options for you to install
directly from the source code.
------
Java calls the process of going from source files (.java) to .class files compiling. However, the result
can't run on it's own. The result is a preprocessed set of instructions ( p-code ) that the JVM
( interpretor ) runs. JVM stands for Java "Virtual Machine,", the idea being that .class files are machine
code inside the the VM. It's a cute, if confusing, way for Java to obfuscate it's interpreted nature.
Java "write once run anywhere" dream falters in the real world, particularly on the desktop. There's a
reason Java enjoys its greatest popularity in the middle tier, where UI doesn't come into play.
-----
Overall, Java is a small language, closer in size to Pascal or C than Ada or C++.
Java's relatively small size is a powerful argument in its favor as a teaching
language.
Type Checking
-----
Here are some of the measures that Java uses to achieve robustness: