Template Method: Loans Exercise
Template Method Exercise
This exercise involves three
CapitalStrategy
subclasses for the loan types, Term Loan, Advised Line and Revolver.All of these subclasses implement a capital(...)
method:
Each of the
capital(...)
methods contains duplicated code.
Your job is to remove the duplication by refactoring to a Template Method.
(Reading...)
Formatting Hints:
To format... | use this markup: |
---|---|
source code | {source:lang=java|lineNumbers=false}...{source} (Supported languages: java, cpp, csharp, c, python.) |
bold text | __some text__ |
italicized text | ~~some text~~ |
underlined text | @@some text@@ |
a method or class name | ``myMethod(...)`` |