Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Class$#.class . . . what does it mean?
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Aziz




PostPosted: Thu Jul 27, 2006 12:43 pm   Post subject: Class$#.class . . . what does it mean?

When I compile my main proggy, it compiles all the other class it uses, I get that, but why does it spit out several different .class files?

The whole project uses these files:

code:
HourRecorder.java
PunchClock.java
PunchTime.java
PayStub.java
InOutDialog.java
PunchInOutException.java


Now, I compile HourRecorder.java, and it spits out:

code:
HourRecorder.class
HourRecorder$1.class
HourRecorder$2.class
HourRecorder$3.class
HourRecorder$4.class
HourRecorder$5.class
HourRecorder$6.class
HourRecorder$7.class
InOutDialog.class
InOutDialog$1.class
InOutDialog$2.class
InOutDialog$3.class
PayStub.class
PayStub$1.class
PunchClock.class
PunchTime.class
PunchInOutException.class


My question is, why all the files? And do I need them all? All the $# files are 1KB (not the originals). I'm ... jarring...jarring?....anyways, im making a jar file and all these are going in, it's worked before and I'm not too concerned over a extra 10KB, but why?
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Thu Jul 27, 2006 1:09 pm   Post subject: (No subject)

Post the code for HourRecorder.java.
wtd




PostPosted: Thu Jul 27, 2006 1:13 pm   Post subject: (No subject)

Ah, found the source.

You create anonymous inner classes in your class.

code:
new ActionListener() {
   public void actionPerformed(ActionEvent e) {
      actionIn();
   }
}


These have to be given some unique name, so they are.
Aziz




PostPosted: Thu Jul 27, 2006 2:20 pm   Post subject: (No subject)

Oh, okay, that makes sense. So, this is perfectly fine, right? Anonymous inner classes are good . . . right?
wtd




PostPosted: Thu Jul 27, 2006 4:16 pm   Post subject: (No subject)

It is fine.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: