mercredi 27 mai 2015

Can Java class files use reserved keywords as names?

I'm aware that Java-the-compilable-programming-language is not one and the same as Java-the-bytecode-format-for-JVM-execution. There are examples of things that are valid in the .class format but not in the .java source code, such as constructor-less classes and synthetic methods.

  1. If we hand-craft a .class file with a reserved Java language keyword (e.g. int, while) as the class, method, or field name, will the Java virtual machine accept it for loading?

  2. If the class is loaded, does it imply that the only way to access this class or member is through Java reflection, because the name is syntactically illegal in the Java programming language?





Aucun commentaire:

Enregistrer un commentaire