0

I've noticed that when compiling using javac it not only creates .class but also creates $1.class , $2.class... I don't seem to understand the purpose of creation of $n.class when they can all be compiled into one .class file. Is there any purpose for this behavior? Or is my interpretation of how javac works entirely wrong?

  • the $1 classes are inner classes –  Mar 26 '15 at 15:04
  • 1
    Your original question was closed as a duplicate. If you want to ask another, different question, then do that: ask another question. Editing an already closed question won't allow anyone to answer. Note that you should post the output of javap and the reasoning that made you think $1 is the second runnable. – JB Nizet Mar 26 '15 at 15:24
  • @Paul They are *anonymous* inner classes. – user207421 Mar 26 '15 at 17:40

0 Answers0