I'm reviewing a certain project and I see that there are many classes with the same name, but with a dollar ($) symbol at the end + increasing number. For example
Class.ja开发者_StackOverflow社区va
Class$1.java
Class$2.java
Class$n.java
OtherClass.java
OtherClass$1.java
OtherClass$n.java
What does it mean?
AFAIK if it's has number it's an anonymous inner class, if it has a name after $ sign it means just inner class.
Edit:
More about how compiler handles you can see here
The dollar sign is used by the compiler for inner classes. I thought it would be strange to manually make classes/files with those names though: As far as I know it's a compiler thing.
精彩评论