float数组转字符串实施方案小记

        float[] floats = {1.2f , 3.5f , 6.4f};
        Double[] doubles = IntStream.range(0, floats.length).mapToDouble(i -> Double.valueOf(floats[i])).boxed().toArray(Double[]::new);
        String join = StringUtils.join(doubles, ",");
        System.out.println(join);

Java8 stream

实际开发中 , 基本类型的数组在操作过程中 , 十分讨厌 , 远没有包装类型调度过程中来的爽快 , 

就连stream在操作float数组时 , 都采取了避坑策略 。

最终代码如上 。

原文地址:https://www.cnblogs.com/nyatom/p/9609368.html