Skip to content

Tag: jvm

How is a constructor executed?

I am making some revisions from the lecture slides and it says a constructor is executed in the following way: If the constructor starts with this, recursively execute the indicated constructor, then go to step 4. Invoke the explicitly or implicitly indicated superclass constructor (unless this class is java.…

Java – Get a list of all Classes loaded in the JVM

I would like to get a list of all the classes belonging to a certain package as well as all of their children. The classes may or may not be already loaded in the JVM. Answer Well, what I did was simply listing all the files in the classpath. It may not be a glorious solution, but it works reliably