Hi,
When a program is compiled, say a C++ program, the result is an executable that is specific to the CPU that it was compiled against. That means that a C++ program compiled on a PC cant run on say a Mac because a Mac has a different CPU to a PC.
When a Java program is compiled, it produces the bytecode file you mentioned. This isn't specific to any CPU and has to be further interpreted at runtime to be able to run.
It is interpreted by the "Java Virtual Machine" (or JVM) which is another program that knows what to do with that bytecode. On a PC, the JVM interprets the bytecode and does things with "windows", whereas on a Unix box, the JVM might do equivalent things with Motif - kind of windows for unix.
That makes the java code portable.
One of the problems with java is that its much slower than a "native executable" because of the need to interpret each command as its executed.
The need for portibility is an interesting question. Some programs are really designedto run on a particular platform like a PC so there isn't a real benefit to it being able to run anywhere else.
Some programs benefit from being able to run on any platform. If nothing else, it doubles the market size for that program for little or no extra work.
...but also means that a program can have "cross platform components" written in the same language. Which is great for support and cost.
(continued...)