If you want to ask Java questions, try the Java forum, please.
I'll get you started with the Java version of my code, but then it's time to change forums, okay?
Untested, and my Java is slightly rusty, but I think that's right.
double futureValueOf( double presentValue, double periodicInterestRate, int numberOfPeriods )
double periodicGrowth = 1.0 + periodicInterestRate;
double factor = 1.0;
for ( int period = 1; period <= numberOfPeriods; ++period )
factor = factor * periodicGrowth;
return presentValue * factor;