Hi Mark,
You have asked a very fundemental question about the internal workings of Java which may not be easy to explain or to understand. Well, here goes:
When you compile Java source code, you generate byte code for the JVM which fetches each bytecode one by one and executes a piece of native machine code equivalent to each Java bytecode.
Now, how does this relate to memory space on the machine?
The JVM makes extensive use of stacks where values are loaded on and popped off. Each position on the stack is referred to by a local variable array. So using your example code, the variable int a will be stored in the zeroth element of the local variable array. It will reference the first position of the stack that stores your value integer 5.
The stack will then be manipulated by instructions in the bytecode.
Is that clear as mud?
Don't lose sleep over it Mark because I don't think you will be asked about it in the exam.
chung