From d4ff437cd29ab814d90ac1e267422e95fb86410e Mon Sep 17 00:00:00 2001 From: eswarseeram Date: Mon, 24 Nov 2025 17:17:19 +0530 Subject: [PATCH] fix: correct error message in surfaceAreaCylinder method --- src/main/java/com/thealgorithms/maths/Area.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/thealgorithms/maths/Area.java b/src/main/java/com/thealgorithms/maths/Area.java index 7a06fd5e5fa0..a610e4e03f26 100644 --- a/src/main/java/com/thealgorithms/maths/Area.java +++ b/src/main/java/com/thealgorithms/maths/Area.java @@ -77,7 +77,7 @@ public static double surfaceAreaCylinder(final double radius, final double heigh throw new IllegalArgumentException(POSITIVE_RADIUS); } if (height <= 0) { - throw new IllegalArgumentException(POSITIVE_RADIUS); + throw new IllegalArgumentException(POSITIVE_HEIGHT); } return 2 * (Math.PI * radius * radius + Math.PI * radius * height); }