Java software is typically delivered over a network, and can also be
installed on computers from traditional media such as CD-ROMs. The same
program or software component can run on a variety of computers and
devices.
Java programs run on so many different kinds of systems thanks to a
component of the platform called the Java virtual machine -- a kind of
translator that turns general Java platform instructions into tailored
commands that make the devices do their work.
How Java works in a mobile hand phone?
How Java works in a web browser?