Code example:
public class Foo { public class Bar { public void printMesg(String body) { System.out.println(body); } } public static void main(String[] args) {
Is it possible to create a new instance of the Bar class with its name? I tried using:
Class c = Class.forName("Foo$Bar")
it finds the class, but when I use c.newInstance (), it throws an ExceptionExceptionException.
java reflection inner-classes
kars7e Jan 19 '10 at 23:20 2010-01-19 23:20
source share