samedi 20 juin 2020

How to load java class and its reference class recursively

Image The class digram like this:

class A {
  B b;
}

class B {
  C c;
}

class C {
}

I wanna load class A、B and C, but when I try class.forName("A") the JVM only loads class A, how can I load all classes from A to C recursively?





Aucun commentaire:

Enregistrer un commentaire