add javadoc to AreaCalculator
This commit is contained in:
@@ -1,7 +1,17 @@
|
|||||||
package ru.lionarius;
|
package ru.lionarius;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A class that provides methods to calculate the area of different geometric shapes.
|
||||||
|
*/
|
||||||
public class AreaCalculator {
|
public class AreaCalculator {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the area of a circle given its radius.
|
||||||
|
*
|
||||||
|
* @param radius The radius of the circle.
|
||||||
|
* @return The area of the circle.
|
||||||
|
* @throws IllegalArgumentException if the radius is negative.
|
||||||
|
*/
|
||||||
public double circle(double radius) {
|
public double circle(double radius) {
|
||||||
if (radius < 0.0)
|
if (radius < 0.0)
|
||||||
throw new IllegalArgumentException("radius cannot be negative");
|
throw new IllegalArgumentException("radius cannot be negative");
|
||||||
|
|||||||
Reference in New Issue
Block a user