2 ms·
They're not classes in source code. As an implementation detail, certain compilation strategies do generate them anyway.
by recursive 7y ago
They're not classes in source code. As an implementation detail, certain compilation strategies do generate them anyway.
- pvg 7y agoWhich ones?
- recursive 7y agoI don't know much about compilers, but basically the ones don't have anywhere else to put the context of a closure.
- pvg 7y agoI don't think that's what happens in the JVM, you can google up the invokevitual + other supporting gunk/mechanism for this.
- recursive 7y agohttps://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.5.invokevirtual https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.ht... makes plenty of references to dispatching based on class.
- pvg 7y agoD'oh, sorry I sent you on a wild goose chase - you want invokedynamic. Invokedynamic and lambdas.