Here you can find the source of squareArea(final double side)
Parameter | Description |
---|---|
side | a double value indicating the length of the square's side. |
public static double squareArea(final double side)
//package com.java2s; /*/*from w ww. j a va2 s.c o m*/ * Copyright 2016 Author or Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ public class Main { /** * Calculates the area of a square. * * @param side a double value indicating the length of the square's side. * @return the area of a square given the length of a side. * @see #rectangleArea(double, double) */ public static double squareArea(final double side) { return rectangleArea(side, side); } /** * Calculates the area of a rectangle. * * @param length a double value indicating the length of the rectangle. * @param height a double value indicating the height of the rectangle. * @return the area of a rectangle given the length and height. */ public static double rectangleArea(final double length, final double height) { return (length * height); } }