File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
src/main/java/com/thealgorithms/maths Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,7 @@ public final class Average {
1616
1717 // Prevent instantiation of this utility class
1818 private Average () {
19- throw new UnsupportedOperationException (
20- "This is a utility class and cannot be instantiated." );
19+ throw new UnsupportedOperationException ("This is a utility class and cannot be instantiated." );
2120 }
2221
2322 /**
@@ -32,8 +31,7 @@ private Average() {
3231 */
3332 public static double average (double [] numbers ) {
3433 if (numbers == null || numbers .length == 0 ) {
35- throw new IllegalArgumentException (
36- "Numbers array cannot be empty or null" );
34+ throw new IllegalArgumentException ("Numbers array cannot be empty or null" );
3735 }
3836 double sum = 0 ;
3937 for (double number : numbers ) {
@@ -54,8 +52,7 @@ public static double average(double[] numbers) {
5452 */
5553 public static long average (int [] numbers ) {
5654 if (numbers == null || numbers .length == 0 ) {
57- throw new IllegalArgumentException (
58- "Numbers array cannot be empty or null" );
55+ throw new IllegalArgumentException ("Numbers array cannot be empty or null" );
5956 }
6057 long sum = 0 ;
6158 for (int number : numbers ) {
You can’t perform that action at this time.
0 commit comments