Вам не нужен массив, в этом примере используется рекурсивная функция / метод:
import java.util.Scanner;
public class Code{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int min = prompt(sc, 1, 5); /* prompts for 5 values, change as required */
sc.close();
System.out.printf("Minium value is: %d%n", min);
}
private static int prompt(Scanner sc, int count, int times){
System.out.printf("Enter number %d of %d: ", count, times);
int n = sc.nextInt();
if(count == times){
return n;
}
return Math.min(n, prompt(sc, (1 + count), times));
}
}