Example:
System.out.println(new Date());
Now obviously this is part of a larger program, but you can see what this does. Now, I run the compiler once, and then run the program. Then, without compiling the program again, I run it and the date updates. This might seem stupid but how does the date update without updating the bytecode?
From my understanding through what I have read the Java compiler takes my source code and compiles it to bytecode, which is saved in a class file. The JIT converts this code to machine code and it runs. However, wouldn't the state of the Date object stay the same? It obviously doesn't. I am just confused on how it changes.