Tuesday, May 4, 2010

Class.forName("classname").newInstance()

Don't do this foolish mistake again :|

I was trying to get the class instance using Class.forname(...) but continuosly getting IllegalAccessException.

At the end I found that the class I am trying to call has a private constructor in it. So it cannot be possible to create an instance of class with private constructor.


rizzz86

No comments: