java, reflection , innerclass,
Hi i want to get the object of inner class using reflection but i am getting some error in it. code is:- package reflaction; public class MyReflection { public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { Class obj = Class.forName("reflaction.MyReflection$TestReflection"); TestReflection a = (TestReflection) obj.newInstance(); a.demo(); } class TestReflection { public void demo(){ System.out.println("reflection occurs"); } } } and the error is :-- Exception in thread "main" java.lang.InstantiationException: reflaction