關於String的contains(null)問題

      今天忽然遇到一個問題, 在使用contains的時候, 出現了空指針異常,spa 例如: "testStr".contains(null); 指針 就會拋出NullPointerException空指針異常.對象 因此在使用的時候,contains()中的對象不能爲null.io
相關文章
相關標籤/搜索