guest (guest)
Any java programmer knows that he has to create an instance of the child class. So one of the reason why getting nullpointerexception is

if you code a condition like this

if (xxx==10) {

while the complier finds that the value is null, the npex appears. Possible solution is to use

if (xxx!=null) first to avoid it.

2000-9-5 -04:00

回到话题: Java Q&A (2) (compiled by jabber)

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论