String类型的List转成String类型数组

List<Master> masters = ms.queryAllMasters();
        List<String> masterReligious = new ArrayList<>();
        for (Master master : masters) {
            masterReligious.add(master.getMasterReligious());
        }

        String[] strings = masterReligious.toArray(new String[masterReligious.size()]);

猜你喜欢

转载自blog.csdn.net/weixin_42273990/article/details/81165563
今日推荐