How Compiler and Interpreter works in Java ?