title: Static vs. instance method for shared use
body: <p>Here's what I am trying to determine...</p>
  
  <p>I have a utility class to append lines to a text file.
  This must be used by a number of other classes, like
  a common logging file.</p>
  
  <p>In my first implementation, I had all the classes
  that wanted to use it make a reference-less instance, e.g.</p>
  
  <p><code>new Logger(logline,logname);</code></p>
  
  <p>The constructor creates a <code>PrintWriter</code>, appends the line
  and closes the file.</p>
  
  <p>This seemed wasteful, since a new instance gets made for
  every line appended.</p>
  
  <p>The alternative was to use a static method, called "writeln"
  in this common class, since I had understood that static
  methods and data re-use the same memory over &amp; over...but</p>
  
  <p>this static method creates an instance of <code>PrintWriter</code>
  to do its job, so doesn't that mean that a new instance
  of <code>PrintWriter</code> is created for every line, like #1?</p>
  
  <p>Anyway, (I am relatively new to Java ) is there a
  well-known, approved way of doing this, or do we 
  just create away, and let the garbage-collector
  clean up after us?</p>
  
  <p>Thanks</p>