This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
we pass a method address to other thread,and let them to call our method,this method is a callback method,since in java,we can not pass method address,so we use interface,we pass a reference of real object of that interface(implement),other thread use the contract(interface) to call method defined in our interface and implement in out real object. about inline method,please see this(refered fome thinking in java):
The second reason for final methods is efficiency. If you make a method final, you are allowing the compiler to turn any calls to that method into inline calls. When the compiler sees a final method call, it can (at its discretion) skip the normal approach of inserting code to perform the method call mechanism (push arguments on the stack, hop over to the method code and execute it, hop back and clean off the stack arguments, and deal with the return value) and instead replace the method call with a copy of the actual code in the method body. This eliminates the overhead of the method call. Of course, if a method is big, then your code begins to bloat, and you probably won�t see any performance gains from inlining, since any improvements will be dwarfed by the amount of time spent inside the method. It is implied that the Java compiler is able to detect these situations and choose wisely whether to inline a final method. However, it�s best to let the compiler and JVM handle efficiency issues and make a method final only if you want to explicitly prevent overriding hope it's help you