1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

add abstract class to existing code

Discussion in 'Java' started by alllenbaldwin, Jun 10, 2010.

  1. alllenbaldwin

    alllenbaldwin New Member

    Joined:
    Jun 10, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    // Mortgage.java: Encapsulate mortgage information
    public static void main(String[] args) {
    MortgageInformation mi = new MortgageInformation(300000, 30, 5.75);
    AmortizationTable at = new AmortizationTable(mi);
    at.DisplayAmortizationTable();

    public class MortgageInformation {
    private double annualInterestRate;
    private int numOfYears;
    private double loanAmount;
    private double principal, term, apr;
    public MortgageInformation() {
    /** Default constructor */
    public Mortgage() {
    this(7.5, 30, 100000);
    }
     

Share This Page