Friday, January 14, 2011

Method Invocation in Java

While listening to one of the webinars, I revised on following different kind of method invocations at bytecode level:

invoke_virtual: allows to call polymorphic method
invoke_special:allows to call private methods
invoke_static: allows to call static method
invoke_interface: allows to call interface methods

All of the other are static typed and an object type needs to be known.

With Java 7, another method is supported which invoke_dynamic

How Clojures are implemented in JVM languages such as groovy, scala:

Using anonymous inner classes, although these are not most efficient way of doing the same.

No comments:

Post a Comment