java快速寻找一个数组的最大值或最小值, min, max,三种方法


		int[] prices = {7,1,5,3,6,4};
		//求出最大值的几种方式
		int max = Arrays.stream(prices).max().getAsInt();
		System.out.println(max);
		int max1 = Collections.max(Arrays.asList(ArrayUtils.toObject(prices)));
		System.out.println(max1);
		
		Arrays.sort(prices);
		System.out.println(prices[prices.length - 1]);