Bytecode features not available in the Java language

Viewed 57978

Are there currently (Java 6) things you can do in Java bytecode that you can't do from within the Java language?

I know both are Turing complete, so read "can do" as "can do significantly faster/better, or just in a different way".

I'm thinking of extra bytecodes like invokedynamic, which can't be generated using Java, except that specific one is for a future version.

9 Answers

In Java, if you attempt to override a public method with a protected method (or any other reduction in access), you get an error: "attempting to assign weaker access privileges". If you do it with JVM bytecode, the verifier is fine with it, and you can call these methods via the parent class as if they were public.

Related