I am not sure how to use the min method within the other method?? do i just move it into the other method so that it runs it with in?? im focused.
package com.codegym.task.task02.task0217;
/*
Minimum of four numbers
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
//write your code here
int smaller;
int smallest;
smaller = Math.min(a, Math.min(b, c));
smaller = smallest = Math.min(smaller, d);
return smallest;
}
public static int min(int a, int b) {
//write your code here
int small;
small = Math.min(a, b);
return small;
}
public static void main(String[] args) throws Exception {
System.out.println(min(-20, -10));
System.out.println(min(-20, -10, -30, -40));
System.out.println(min(-20, -10, -30, 40));
System.out.println(min(-40, -10, -30, 40));
}
}