java数组去重

        String[] someArr =new String[]{"a","b","c","a"};
        //去重
        someArr=Arrays.stream(someArr).distinct().toArray(String[]::new);
        Arrays.stream(someArr).forEach(System.out::println);

 

posted @ 2021-09-19 12:12  gongzz  阅读(168)  评论(0编辑  收藏  举报