Over a million developers have joined DZone.

Mortgage Payment Calculator In Java

DZone's Guide to

Mortgage Payment Calculator In Java

· ·
Free Resource
This below Java code will help you to find the monthly payment for the Mortgage payment. Here the array term has months required to payoff the mortgage and array rates interest rate for the mortgage and loan has the loan amount value. This code will perform mortgage comparison

import java.math.*;
import java.text.*;
class MortgageCalculator {
public static void main(String arguments[]) {
//Program Variables using array
double []terms = {84,180,360};//Mortgage Loan Term
double []Rates = {0.0535, 0.055, 0.0575};//Mortgage Loan's Interest Rate
double loan = 200000;//Loan Amount

double term, interestRate; //Temporary variables to make things generic and clearer

DecimalFormat df = new DecimalFormat("$###,###.00"); //Formatting the output

//for each term and Rate starting from the first location of each array terms[] and Rates[]
for (int i=0;i
For online mortgage comparison 
   Mortgage Payment Calculator

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}