Joseph,
First of all, let's be clear of some facts:
1. From 1960's to now, computers are not getting any smarter, rather, just more and more complex.
2. What does a computer compute? Actual value like 10 in the equation 1+9=10 and the address where the 1, 9 and 10 reside.
In the good old days, programmers could happily say "put the 1 into register #1 and 9 into register #2 and add the content in register #1 and #2 and put the result into register #3 and then return the content in register #3." to computers in assembly languages, which are appealing to chips. Since there were not too many different chips then, it was not too difficult for programmers to work around smoothly. But, it's inrealistic today. Business logic are gaining more and more weight in big applications the world cannot expect every programmer thinking in Church-Turing logic and can talk to chips directly. That's why high-level languages like Basic, C and Java were born. But the computers are not getting smarter, they only understand the low level machine instructions. Compiler's mission is to translate the human-being frindly high-level language into machine code. In a language every built-in operations have their unique codes in this language. Let's assume 1 for + and 2 or - and 3 for * and so on. You write +|-|*|/ in your source code and what's in .class file then? Binary representation of the code of the operations: 0001|0010|0011|.... (Of course the operations are not limited in arithmetic ones ); Since most programs are loaded into memory dynamically, in the .class file there must be also information for loaders and linkers, for the CPU to caculate the address of related values involved in the program. For your question " What is stored therein?", my understanding is three type of things:
1. binary representation of the values;
2. binary representation of the operation code;
3. binary representation of the addressing information.
and, your source code talks to jvm, jvm talks to os, os talks to hardware. The .class files are only understood by the jvm. And jvm does the dirty work of translating the java byte code into machine language which the OS understands. So-called "platform-independence" of java actually means, the format of the byte code is standardized, Sun and other vendors have done the JVM --> OS layer for you. If you try to run a .class file on a new chip for which the JVM --> OS layer ( or JVM --> hardware layer for embedded system) hasn't been implemented, it won't run. Anyway, the .class files make your life much
easier.
Regards,
Ellen