Not sure if I am asking a sound question. I know every inner class keeps a reference to the enclosing class object. So can I reference the enclosing class object outside tha
You can do this to see if t is an inner class of B:
t
B
public static void foo(Thread t) { System.out.println(t.getClass().getName().contains("B$")); // OR System.out.println(t.getClass().getEnclosingClass().equals(B.class)); }