Extract Method
From CSSEMediaWiki
(Difference between revisions)
(Moved Extract method explanation from the duplicate code page to here) |
(→Refactoring) |
||
Line 1: | Line 1: | ||
− | + | printOwing() { | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
printBanner(); | printBanner(); | ||
Revision as of 04:20, 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); }