Formula to calculate cube Surface - Android java.lang

Android examples for java.lang:Math Formula

Description

Formula to calculate cube Surface

Demo Code


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();
        }
    }
}

Related Tutorials