当前位置: 首页 > news >正文

网站seo提升南宁律师网站建设

网站seo提升,南宁律师网站建设,东莞大岭山中西医结合医院,做公益的网站今天调试程序时#xff0c;在调用Properties类的setProperty(String key, String value)方法时#xff0c;遇到了一个小问题#xff0c;程序运行到该语句时抛出异常#xff0c;提示java.lang.NullPointerException#xff0c;调查了半天#xff0c;发现问题出在调用setPr… 今天调试程序时在调用Properties类的setProperty(String key, String value)方法时遇到了一个小问题程序运行到该语句时抛出异常提示java.lang.NullPointerException调查了半天发现问题出在调用setProperty(String key, String value)时传递给该方法的value参数的值为null由于调用setProperty(String key, String value)方法时它会去调用Hashtable类中的public synchronized Object put(Object key, Object value)方法查看该方法的源代码实现代码的开始处就给出了答案  1public synchronized Object put(Object key, Object value)  { 2    // Make sure the value is not null 3    if (value  null) { 4        throw new NullPointerException(); 5    } 6 7    // Makes sure the key is not already in the hashtable. 8    Entry tab[]  table; 9    int hash  key.hashCode();10    int index  (hash  0x7FFFFFFF) % tab.length;11    for (Entry e  tab[index] ; e ! null ; e  e.next) {12        if ((e.hash  hash)  e.key.equals(key)) {13        Object old  e.value;14        e.value  value;15        return old;16        }17    }1819    modCount;20    if (count  threshold) {21        // Rehash the table if the threshold is exceeded22        rehash();2324            tab  table;25            index  (hash  0x7FFFFFFF) % tab.length;26    } 2728    // Creates the new entry.29    Entry e  new Entry(hash, key, value, tab[index]);30    tab[index]  e;31    count;32    return null;33    } 就此问题的根源找到了以后写程序的时候得多注意这些细节。以下附上setProperty(String key, String value)方法的描述  1 Object java.util.Properties.setProperty(String key, String value) 2Calls the Hashtable method put. Provided for parallelism with the getProperty method. Enforces use of strings for  property keys and values. The value returned is the result of the Hashtable call to put.  3  4 See Also: 5 getProperty 6 Parameters: 7key: the key to be placed into this  property list. 8 value: the value corresponding to key. 9 Returns:10the previous value of the specified key in this property list, or null if  it did not have one.11 Since: 1.2 转载于:https://www.cnblogs.com/xxpal/articles/837400.html
http://www.dnsts.com.cn/news/238884.html

相关文章:

  • 民网东莞网站建设佛山网站制作平台
  • 网站推广有哪些常用的方法抖音seo软件工具
  • 深圳市公司网站建设平台企业宣传片制作公司光年映画
  • wordpress建站时间无忧网站建设价格
  • 静安区网站开发wordpress+HTML5游戏
  • 怎么在国外做网站国家重大建设项目网站地址
  • 中国建设局网站首页中国门户网站
  • 做名片的网站wordpress 调用摘要
  • 网站开发都需要哪些图免费领手机 网站
  • 深圳专业制作网站公司吗建设部网站内装修标准
  • 济南城市建设集团网站常州工厂网站建设
  • 做网站卖机器wordpress图片文件夹更换
  • 网站建设推广怎么做北京定制网站
  • 做律师咨询网站能下载的网站
  • 宾县建设局网站神马网站排名
  • 著名设计网站开发游戏软件赚钱吗
  • 中小企业网站开发网络公司怎样推广网站
  • php网站建设实训引言免费做课设的网站
  • 做公司网站需要天天向上 网站建设
  • 网站核验单下载静态网站源码下载
  • 重庆网站建设leco tecwordpress使用评论
  • 免费视频素材下载的网站手机界面设计教程
  • 网站的话术网站首页怎么制作
  • c 可以用来做网站吗成都本地网站
  • 播州区建设局网站网站建设创意广告词
  • 淘宝网站建设成本佛山百度推广公司
  • 如何做文献ppt模板下载网站免费ppt大全网
  • 公司网站seo怎么做新的网站建设技术
  • 做网站用哪个软件写比较好网页游戏网页游戏大全
  • 工程资料类网站怎么做win2008网站404