Java关于数字工具类~持续汇总~
. 1描述:求int数组中最大值 /** * 01 * 描述:求int数组中最大值 * 【时间 2019年3月5日下午3:21:36 作者 陶攀峰】 */ public static int test01(int[]sz) { int max = sz[0]; for(int x=1; x<sz.length; x++) { if(sz[x]>max){ max = sz[x]; } } return max; } 2描述:数组排序(从小到大)~传入int数组 .返回int数组. /** * 02 * 描述:数组排序(从小到大)~传入int数组 .返回int数组. * 【时间 2019年3月5日下午3:24:11 作者 陶攀峰】 */ public static int[] test02(int[]sz) { for(int x=0; x<sz.length-1; x++) { for(int y=x+1; y<sz.length; y++) { if(sz[x]>sz[y]) { int temp = sz[x]; sz[x] = sz[y]; sz[y] = temp; } } } return sz; } 3描述:冒泡排序(从小到大)~传入int数组 .返回int数组. /** * 03 * 描述:冒泡排序(从小到大)~传入int数组 .返回int数组. * 【时间