java中 null与null作比较
时间: 2024-01-30 07:33:36 浏览: 176
回答: 在Java中,当两个引用类型的变量都为null时,它们是相等的。也就是说,null与null作比较的结果是相等的。这是因为null表示缺失的东西,它不代表任何具体的值。所以,无论是将null与null进行比较,还是将null与其他引用类型的变量进行比较,结果都是相等的。
#### 引用[.reference_title]
- *1* [java中的null](https://blog.csdn.net/chinusyan/article/details/120583287)[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^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Java中关于Null的9个解释(Java Null详解)](https://blog.csdn.net/weixin_36106506/article/details/114043795)[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^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Java中的Null到底是什么](https://blog.csdn.net/weixin_39624071/article/details/114545873)[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^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文