Extract Method

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
(Refactoring)
Line 1: Line 1:
printOwing() {
+
 
 +
printOwing() {
 
                 printBanner();
 
                 printBanner();
 
          
 
          

Revision as of 04:21, 11 September 2008

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