public static int min2(Stack <Integer> st, int min) {
if(st.isEmpty()) {
return min;
}
int num= st.pop();
if(num<min) {
min=num;
}
return min2(st,min);
I wrote this code for finding min value in stack and I used another parameter->int min which I'd like to get rid of & don't understand what I should ask from the user to enter to the parameter.