Calculate Compound Interest – Java Example


In this Java example code we will calculate the compound interest with given principal, annual interest rate, unit and time period values.

Compound Interest = P (1 + R/n) (nt) – P

P — the principal investment amount (the initial deposit or loan amount)
r — the annual interest rate (decimal)
n — the number of times that interest is compounded per unit t
t — the time the money is invested or borrowed for

Java method to calculate compound interest with given P, t, r and n values.

Share This Post On: