Exception when access inner class reflectively
- by MikeJiang
Hi Folk,
Here is a sample java program.
I wonder why the two approaches reslut different stories. Is it a bug or kind of bitter java feature?
And I run the sample upon java 1.5
package test;
public class TestOut{
public static void main(String[] args){
new TestIn();//it works
Class.forName("test.TestOut$TestIn").newInstance();// throw IllegalAccessException
}
private static class TestIn{}
}