Android examples for java.lang:Math Formula
Formula to calculate cube Surface
import java.text.DecimalFormat; public class Main{ private static double result; public static double cubeSurface(double side) throws InvalidInputException { if (side >= 0) { result = side * side * 6;// w w w . ja v a 2s . co m return result; } else { throw new InvalidInputException(); } } }