1、在你的项目中引入hutool的jar包

2、创建一个double数组并初始化一些元素

3、public static dou水瑞侮瑜ble[] swap(double[] array, int index1, int index2)//来查看一下这个方法的源码

4、double[] swap = ArrayUtil.swap(s, 2, 4);//将参数放入并调用方法

5、String s1 = JSONUtil.toJsonStr(swap);//将结果json化查看结果

1、在你的项目中引入hutool的jar包
2、创建一个double数组并初始化一些元素
3、public static dou水瑞侮瑜ble[] swap(double[] array, int index1, int index2)//来查看一下这个方法的源码
4、double[] swap = ArrayUtil.swap(s, 2, 4);//将参数放入并调用方法
5、String s1 = JSONUtil.toJsonStr(swap);//将结果json化查看结果