问题:
Exception in thread "main" java.lang.NullPointerException
截图:
原因:
该报错是由于HashTable中put进了NULL值导致的,虽然HashTabale现在已经基本被淘汰了,但是相信还是有人会出现这个问题。
前言:
HashMap与HashTable和ConcurrentHashMap是Java开发人员大都经历过的知识点,今天就说一说他们之间的区别与优缺点
该报错是由于HashTable中put进了NULL值导致的,虽然HashTabale现在已经基本被淘汰了,但是相信还是有人会出现这个问题。
HashMap与HashTable和ConcurrentHashMap是Java开发人员大都经历过的知识点,今天就说一说他们之间的区别与优缺点