Jacob Sonia wrote:ExceptionHierarchy e = new ExceptionHierarchy();
you have declared ExceptionHierarchy as inner class.... so it can't live without the object of the enclosing class.....
try new Exception().new ExceptionHierarchy().....
but this type of coding is a bad idea i suppose............