MethodHandle - What is it all about?

后端 未结 4 1933
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 14:15

I am studying new features of JDK 1.7 and I just can\'t get it what MethodHandle is designed for? I understand (direct) invocation of the static method (and use of Core Refl

4条回答
  •  -上瘾入骨i
    2020-12-04 14:59

    Think of MethodHandle as a modern, more flexible, more typesafe way of doing reflection.

    It's currently in the early stages of its lifecycle - but over time has the potential to be optimized to become must faster than reflection - to the point that it can become as fast as a regular method call.

提交回复
热议问题