There is a very simple program:
public class A { public static void main(String[] p) { final Runnable r = new Runnable() { public void run() { System.out.println(r); } }; r.run(); } }
And it gives:
$ javac A.java A.java:6: variable r might not have been initialized System.out.println(r); ^ 1 error
- Why?
- How does Runnable refer to a variable pointing to it?
(In the real code there is one more level (listener), and the link through this does not work)
java final
18446744073709551615
source share