What does the $ means, EventQueue$1.class(Red marked)
Attached picture
http://i39.photobucket.com/albums/e179/iamcreasy/Untitled-6.jpg
I am using NetBeans.
What does the $ means, EventQueue$1.class(Red marked)
Attached picture
http://i39.photobucket.com/albums/e179/iamcreasy/Untitled-6.jpg
I am using NetBeans.
$ is used as a separation marker for denoting inner classes. For e.g. consider the following class:
public class MyWidget {
static class Oh {
}
public void doIt() {
final Runnable r1 = new Runnable() {
@Override
public void run() {
}
};
final Runnable r2 = new Runnable() {
@Override
public void run() {
}
};
r1.run();
r2.run();
}
}
Here; four class files would be created:
Basically, the format is: OuterClassName$(InnerClassName or number in case of anonymous class).class. In the above case, since we have two anonymous Runnables created, we have $1.class and $2.class.
In case you are unaware of nested classes, more details at: http://download.oracle.com/javase/tutorial/java/javaOO/nested.html
Thanks!
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.