【问题标题】:Create list of lists创建列表列表
【发布时间】:2020-03-13 19:28:51
【问题描述】:

如何创建包含列表且每个列表都有多个字符串的列表。

mylist = [['example01','example02','example03'],[example1','example2','example3'], [example4','example5','example6']]

所以当我做“for each”时仍然得到列表文件?

没有运气的尝试:

List<String> messages = Arrays.asList(("Hello","You"),("World","Power"));

【问题讨论】:

标签: java android list


【解决方案1】:

试试

List<List<String>> messages = Arrays.asList(Arrays.asList("Hello","You"), Arrays.asList("World","Power"));

【讨论】:

    猜你喜欢
    • 2017-10-09
    • 2021-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-18
    • 2017-06-26
    • 2012-09-26
    • 1970-01-01
    相关资源
    最近更新 更多