由于题目不完整,我只是猜想你要的结果
import java.util.Arrays;
import java.util.Random;
public class SumTest {
public static void main(String[] args) {
Random r = new Random();
int[] arr = new int[50];
int start = 10, end = 100, max = 0, sum = 0;
for (int i = 0; i < arr.length; i++) {
arr[i] = r.nextInt(end - start + 1) + start;
max = arr[i] < max ? max : arr[i];
sum += arr[i];
}
System.out.println(Arrays.toString(arr));
System.out.println("最大值:" + max + ";50个值的总和:" + sum);
}
}