Let\'s imagine we have the following classes:
public class Message extends Object {} public class Logger implements ILogger { public void log(Message m) {/
The Server JIT will certainly inline and eventually eliminate the code altogether if you make the reference final: final ILogger l = new Logger(); In a modern JVM most of the optimization is performed by the JIT.