• Post Reply Bookmark Topic Watch Topic
  • New Topic

Locating which public methods can be made private  RSS feed

 
Hedley Finger
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a beginning student of Java using the textbook Objects First with Java by David Barnes and Michael Kolling, with the educational IDE BlueJ.

BlueJ provides a visual representation of classes and objects. You can click on an object on the Object Bench and select any of its public methods to run. Dialogues pop up to let you enter arguments and another dialogue shows you return values. It's very good for beginner;s to test their work as they go.

I give all this background information so you can understand why we are encouraged to make all our methods public initially, just so we can test them interactively. But, when everything is working well, we are expected to make methods private if they are not called from other classes.

It can be quite a chore if you have a lot of classes with many fields, and setters and getters largely there to help set up tests. Does anybody know of a workaround, utility or plub-in that will list all methods not called from any class other than their home class?

Thanks, Hedley

P.S. How can you make the tiny typeface in the Add New Topic form larger? I can barely read it!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!