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 m1;
if(c<d)
m1=c;
else
m1=d;
if(m<m1)
m1=m;
return m1;
}
public static int min(int a, int b) {
//write your code here
int m;
if(a<b)
m=a;
else
m=b;
return m;
}
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));
}
}

# i dont get it wats wrong in my code please someone help me

Resolved

method with two parameters is the method I am talking about. this task gave you min method to complete with the option to have min method with 2 parameters, and a min method with 4 parameters. the code for the min with two parameters works:- public static int min(int a, int b) { //write your code here int m; if(a<b) m=a; else m=b; return m; } for example if you wan to know what is the minimum of {5, 2, 8, 1} take 5 and 2 first and return the minimum of those two then save it in a variable for later, then compare 8 and 1, return the minimum of those two and save it in a variable. finally compare the two results of the above compression for a final minimum number. is that what you were asking about? if not let me knowmin