my dog learned polymorphism
The moose likes Sockets and Internet Protocols and the fly likes exception error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "exception error" Watch "exception error" New topic

exception error

mj zammit
Ranch Hand

Joined: Nov 16, 2008
Posts: 49
when i come to doing the following code:

i get the following error:
Exception: java.lang.NullPointerException

what does this mean?
Joe Ess

Joined: Oct 29, 2001
Posts: 9191

Is this a continuation of your previous topic?
NullPointerException means you tried to invoke a method on an object reference that has not been initialized. If you print the exception stack trace (there's a method in Exception that does it) it will tell you what line the exception occurred on.

[How To Ask Questions On JavaRanch]
mj zammit
Ranch Hand

Joined: Nov 16, 2008
Posts: 49
yes yes it does continue from the previous topic.
I found out why it was not outputting the results
now i am trying to fix it...
I shall try out what you have suggested...
I agree. Here's the link:
subject: exception error
It's not a secret anymore!