Exercises
Using the provided classes, fill in the main class (Disasm.java) in order to extract the following information from the mystery class “X.class”
- Is it a valid java class?
- If it is, what is the minor and major versions of the compiler used to compile it?
- What are its access flags?
- What is the original name of the class? (Hint: It’s not “X.class”).
- Does it extend another class, or implement another interface?
-
Write a simple ClassLoader that you can use to reload the class definition of Test.java at runtime. Between changes you could prompt the user for input and change Test’s source manually, or incrementally generate versions of Test.java
System.out.println(“Version of Test.java : 1”);