When I compile this code it outputs PingPong.class , PingPong$MyThread.class and PingPong$1.class
The first and second I understand, but I don't understand why it outputs PingPong$1.class since there is no anonymous inner class. Or is there?..
This is the PingPong.java file:
Nikolaos Plastiras wrote:When I compile this code it outputs PingPong.class , PingPong$MyThread.class and PingPong$1.class
The first and second I understand, but I don't understand why it outputs PingPong$1.class since there is no anonymous inner class. Or is there?..
This is the PingPong.java file:
Perhaps it is residue from an old incarnation of the class. Did you used to have an anonymous class? If you delete the class files, and recompile again, does it reappear?
Perhaps it is residue from an old incarnation of the class. Did you used to have an anonymous class? If you delete the class files, and recompile again, does it reappear?
Henry
I also see these three classes and I just compiled it for the first time.
Regards,
Dan
William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
I just compiled it and ran it (in Eclipse) and it completed successfully. And I don't see the PingPong$1.class in the compiled classes folder with the other two.
By the way Java 7 is my default runtime. Perhaps this is significant?
Paul Clapham wrote:I just compiled it and ran it (in Eclipse) and it completed successfully. And I don't see the PingPong$1.class in the compiled classes folder with the other two.
By the way Java 7 is my default runtime. Perhaps this is significant?
I did that too and got two files in bin folder. But did a classic (1.6) javac compilation and got three files!
Paul Clapham wrote:I just compiled it and ran it (in Eclipse) and it completed successfully. And I don't see the PingPong$1.class in the compiled classes folder with the other two.
By the way Java 7 is my default runtime. Perhaps this is significant?
I did that too and got two files in bin folder. But did a classic (1.6) javac compilation and got three files!
It works for me too (correctly generated two class files). And yes, I compiled with Java 7.