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

河北网站制作公司报价一般需要多少钱

河北网站制作公司报价,一般需要多少钱,空间设计网站,如何做美食网站设计今天调试程序时,在调用Properties类的setProperty(String key, String value)方法时,遇到了一个小问题,程序运行到该语句时抛出异常,提示java.lang.NullPointerException,调查了半天,发现问题出在调用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)方法,查看该方法的源代码实现,代码的开始处就给出了答案:
 1ExpandedBlockStart.gifContractedBlock.gifpublic synchronized Object put(Object key, Object value)  {
 2InBlock.gif    // Make sure the value is not null

 3ExpandedSubBlockStart.gifContractedSubBlock.gif    if (value == null{
 4InBlock.gif        throw new
 NullPointerException();
 5ExpandedSubBlockEnd.gif    }

 6InBlock.gif
 7InBlock.gif    // Makes sure the key is not already in the hashtable.

 8InBlock.gif    Entry tab[] = table;
 9InBlock.gif    int hash =
 key.hashCode();
10InBlock.gif    int index = (hash & 0x7FFFFFFF%
 tab.length;
11ExpandedSubBlockStart.gifContractedSubBlock.gif    for (Entry e = tab[index] ; e != null ; e = e.next) 
{
12ExpandedSubBlockStart.gifContractedSubBlock.gif        if ((e.hash == hash) && e.key.equals(key)) 
{
13InBlock.gif        Object old =
 e.value;
14InBlock.gif        e.value =
 value;
15InBlock.gif        return
 old;
16ExpandedSubBlockEnd.gif        }

17ExpandedSubBlockEnd.gif    }

18InBlock.gif
19InBlock.gif    modCount++
;
20ExpandedSubBlockStart.gifContractedSubBlock.gif    if (count >= threshold) 
{
21InBlock.gif        // Rehash the table if the threshold is exceeded

22InBlock.gif        rehash();
23
InBlock.gif
24InBlock.gif            tab =
 table;
25InBlock.gif            index = (hash & 0x7FFFFFFF%
 tab.length;
26ExpandedSubBlockEnd.gif    }
 
27
InBlock.gif
28InBlock.gif    // Creates the new entry.

29InBlock.gif    Entry e = new Entry(hash, key, value, tab[index]);
30InBlock.gif    tab[index] =
 e;
31InBlock.gif    count++
;
32InBlock.gif    return null
;
33ExpandedBlockEnd.gif    }

就此,问题的根源找到了,以后写程序的时候得多注意这些细节。以下附上setProperty(String key, String value)方法的描述:
 1None.gif Object java.util.Properties.setProperty(String key, String value)
 2None.gifCalls 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
None.gif
 4
None.gifSee Also:
 5
None.gifgetProperty

 6
None.gifParameters:
 7None.gifkey: the key to be placed into this
 property list.
 8
None.gifvalue: the value corresponding to key.

 9
None.gifReturns:
10None.gifthe previous value of the specified key in this property list, or null if
 it did not have one.

11
None.gifSince: 1.2

转载于:https://www.cnblogs.com/xxpal/articles/837400.html

http://www.yayakq.cn/news/718346/

相关文章:

  • ftp 网站管理网站架构是什么意思
  • 网站的哪些标签需要优化刚建的网站百度搜不到
  • 正能量网站警惕网站免费看手机
  • 梅州新农村建设网站宣传册制作
  • html网站建设代码diy
  • 电子商务网站建设的需求洛阳洛龙区网站建设
  • 健康网站可以做推广吗网站开发合同协议
  • 网站分站是怎么做的天猫开店流程及费用2023
  • 网站如何发布和推广最全磁力搜索引擎
  • 那个网站做图片好看的网络营销在我国的发展历程
  • wordpress+手机站分销平台系统源码
  • 深圳网站建设哪家最好福田庆三鼻子案例
  • 南宁网站建设升上去wordpress tinymce编辑器
  • 购物网站建设案件江苏大汉建设实业集团网站
  • 许昌旅游网站建设现状Wordpress表单无法收到
  • 搭建企业网站具体过程建筑设计公司招聘信息
  • 专业制作网站系统怎么用phpcmf做网站
  • 本地宁波网站建设php宠物用品公司网站源码
  • 百度云服务器做php网站返利导购网站建设需求文档
  • 小说网站排名前十酒店vi设计公司
  • 张店学校网站建设定制wordpress 阿里云 邮件注册
  • 遵义住房城乡建设厅网站黑龙江省建设厅的网站首页
  • 中天建设第四网站阳江房产网二手房出售
  • 外资企业可以在中国境内做网站吗制作灯笼作文
  • seo怎么判断网站的好坏湖南企业网站营销电话
  • 没有网站可以做seo吗百度seo快速提升排名
  • 旅游网站的功能结构图免费一键生成个人网站
  • 建站seo怎么赚钱软件大全
  • 建网站费用记技术服务费网络设计主要是干什么的
  • 苏州网站建设多少钱重庆网站搜索排名