Hacker News new | ask | show | jobs
by bad_user 5970 days ago
What do you mean?

Classes are in some sense like objects, meaning they can hold their own state, but there is no notion of meta-classes like in Smalltalk.

The class in the JVM is like a module that holds functions and attributes. And the JVM byte-code is very class-centric.

The objects themselves are probably not what you think they are. The JVM currently has no notion of "call method next() on object O" ... that's done with something like ... invoke_virtual Enumerable.next(obj). The bytecode "invoke_virtual" is responsible for doing the single-dispatching (subtype-polymorphism) at runtime, otherwise it looks just like an invoke_static ... so the compiler is crucial for generating the correct byte-code, because the class has to be known at runtime ;)