• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Locating which public methods can be made private

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
It will give me the powers of the gods. Not bad for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic