Mega Code Archive

 
Categories / Java Book / 008 Reflection
 

0419 Get method and constructor for a inner or local class

Constructor<?> getEnclosingConstructor() If this Class object represents a local or anonymous class within a constructor, returns a Constructor object representing the immediately enclosing constructor of the underlying class. Method getEnclosingMethod() If this Class object represents a local or anonymous class within a method, returns a Method object representing the immediately enclosing method of the underlying class