我需要转换此字符串数组

String[] myStringArray0 = {"FTMORGANIZATION_NAME","FTMOBJECTNUMBER","FTMCONTAINERTYPE","FTMCONTAINER"};


进入

List<ArrayList<String>>


其中所有“ FTMORGANIZATION_NAME”,“ FTMOBJECTNUMBER”,“ FTMCONTAINERTYPE”,“ FTMCONTAINER”进入ArrayList,然后进入List对象。

有人可以提出建议吗?

最佳答案

String[] myStringArray0 = {"FTMORGANIZATION_NAME","FTMOBJECTNUMBER","FTMCONTAINERTYPE","FTMCONTAINER"};

List<List<String>> result = new ArrayList<>();
result.add(Arrays.asList(myStringArray0));


asList

09-10 05:37