| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1014 人关注过本帖
标题:这样子是什么错误
只看楼主 加入收藏
energylight
Rank: 1
等 级:新手上路
帖 子:194
专家分:0
注 册:2006-6-12
收藏
 问题点数:0 回复次数:4 
这样子是什么错误
编译的时候可以通过,可运行的时候出现如下这个画面
搜索更多相关主题的帖子: 画面 编译 运行 
2007-12-22 08:43
energylight
Rank: 1
等 级:新手上路
帖 子:194
专家分:0
注 册:2006-6-12
收藏
得分:0 
Exception in thread"main"java.lang.NullPointerException
at Notepad2.initEventListener<Notepad2.java:199>
at Notepad2.<init><Notepad2.java:15>
at Notepad2.main<Notepad2.java:224>
Press any key to continue...
2007-12-22 08:46
大葱
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2007-12-21
收藏
得分:0 
空指针错误
Thrown when an application attempts to use null in a case where an object is required. These include:

Calling the instance method of a null object.
Accessing or modifying the field of a null object.
Taking the length of null as if it were an array.
Accessing or modifying the slots of null as if it were an array.
Throwing null as if it were a Throwable value.
2007-12-22 20:35
energylight
Rank: 1
等 级:新手上路
帖 子:194
专家分:0
注 册:2006-6-12
收藏
得分:0 
那要怎么避免或改呢?
2007-12-24 20:10
大葱
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2007-12-21
收藏
得分:0 
能用ECLIP调试出最好,也可以检查一下哪里出错,是不是有的变量可能取NULL值,后面引用又用到这个变量,而你没有处理

避免就是要细心喽,呵呵

愚见,见笑.
2007-12-25 16:13
快速回复:这样子是什么错误
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019664 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved