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