Extract Method

From CSSEMediaWiki
Revision as of 04:20, 11 September 2008 by Jason Clutterbuck (Talk | contribs)
Jump to: navigation, search

printOwing() {

               printBanner();
       
               //print details
               System.out.println ("name:	" + _name);
               System.out.println ("amount	" + getOutstanding());
       }

becomes

       void printOwing() {
               printBanner();
               printDetails(getOutstanding());
       }
       void printDetails (double outstanding) {
               System.out.println ("name:	" + _name);
               System.out.println ("amount	" + outstanding);
       }
Personal tools