java.lang.Class.getEnclosingConstructor()


java.lang.Class.getEnclosingConstructor()

package com.codingdict;



import java.lang.*;



public class ClassDemo {



   public Object c;



   public ClassDemo( ) {

      class ClassA{ };

      c = new ClassA( );

   }



   public Object ClassAObject( ) {

      class ClassA{ };

      return new ClassA( );

   }



   public static void main(String[] args) {



      Class cls;

      cls = (new ClassDemo()).c.getClass();



      System.out.print("getEnclosingConstructor() = ");

      System.out.println(cls.getEnclosingConstructor());

   }

}