This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comment on ActionListener

 
kevin chang
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using follow codes

but i am wondering should i write comments on ActionListerner class and it's actionPerformed() method, any suggestion!
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11888
203
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kevin,
Standard rules apply ... if you think that the code is self explanitory, and can easily be understood by a junior programmer, then dont worry about comments.
But if there is even a chance that a comment or two will make the code easier to understand, then add a comment.
Moving away from your question, why have you marked your code block as transient?
Regards, Andrew
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that there's no need for javadoc comments here. That is, there's a rule that all public methods must have javadoc comments - but that doesn't apply to methods of an anonymous class, since an anonymous class will not appear in javadoc's generated HTML API at all. So forget about javadoc comments here. Non-javadoc comments may still be appropriate, as Andrew suggests.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic