List.contains
时间: 2023-08-24 22:05:37 浏览: 113
JS List的contains方法与Array的contains方法的使用
5星 · 资源好评率100%
List.contains()方法用于判断一个List集合中是否包含指定的元素。该方法会遍历List中的每一个元素,并调用每个元素的equals()方法与指定元素进行比较。如果有一个元素的equals()方法返回true,则contains()方法返回true;否则,所有元素的equals()方法都不返回true,则contains()方法返回false。\[1\]\[2\]\[3\]
#### 引用[.reference_title]
- *1* [List的contains()方法](https://blog.csdn.net/CMTobby/article/details/1762184)[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^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Java中list.contains()的用法](https://blog.csdn.net/qq_48461195/article/details/123126259)[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^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [java中list集合中contains()的用法,啥意思](https://blog.csdn.net/dxyzhbb/article/details/102501105)[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^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文