Skip to content

Instantly share code, notes, and snippets.

@LCamel
Created June 2, 2016 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LCamel/3f5af9fab09bee4bdceab40d56d82c3b to your computer and use it in GitHub Desktop.
Save LCamel/3f5af9fab09bee4bdceab40d56d82c3b to your computer and use it in GitHub Desktop.
inner class
import java.lang.reflect.Constructor;
public class AA {
public static void main(String[] args) throws InterruptedException {
f1();
}
private static void f1() {
int i = 3;
String s = "foo";
Runnable r = new Runnable() {
@Override
public void run() {
System.out.println(i);
System.out.println(s);
}
};
for (Constructor<?> constructor : r.getClass().getDeclaredConstructors()) {
System.out.println(constructor);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment