The compiler does this to save the overhead of actually making a function call, which would involve pushing each parameter on to the stack.

This can be done for non-virtual functions because you won’t know which code it contains if virtual function is overridden by others until runtime. Since java methods are virtual by default. You can make methods static or final to make non-virtual.