Arrays.asList("1", "2", "3");
时间: 2023-08-14 17:06:20 浏览: 169
回答: 当使用Arrays.asList("1", "2", "3")时,返回的是一个包含三个元素的List对象。这是因为传入的参数是字符串类型,而不是数组。所以它会将每个字符串作为一个独立的元素添加到List中。因此,输出的size将是3。
#### 引用[.reference_title]
- *1* *2* [Java Arrays.asList()方法详解](https://blog.csdn.net/w574951402/article/details/53246777)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Arrays.asList() 详解](https://blog.csdn.net/yangzhe19931117/article/details/128287975)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文