if (!Arrays.asList({"-1","1"}).contains("0"))
时间: 2023-10-21 11:23:45 浏览: 118
如果我们使用Arrays.asList()方法来判断某个值是否存在于一个String数组中,例如{"-1","1"},我们会发现对于这个数组来说,它并不包含值"0"。因此,!Arrays.asList({"-1","1"}).contains("0")的结果是true。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [JAVA踩坑之Arrays.asList().contains()](https://blog.csdn.net/xfx_1994/article/details/103527413)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [Arrays.asList contains int无效](https://blog.csdn.net/zjy660358/article/details/106897727)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文