This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
why we get the java null pointer expection error?ANIL
Does anybody have an idea what is meant by this?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
My guess is there'a a Java beginner named Anil who's getting a NullPointerException in his program, and he was hoping the FAQ would answer that. Actually it's not a bad question to cover in the beginner FAQ - newbies get these all the time, and it's not obvious what the cause is, sometimes even if you look at the line that's throwing the error. Alternately, a few days ago we were havnign some problems with the DB underlying several other programs here at JavaRanch - perhaps Anil was actually seeing NullPointerException from the Friki software, because couldn't contact the DB? (Does it use the DB?) If that's the case, restarting the server fixed the DB; all should be OK now.
Hmm, Friki doesn't use a DB, so I doubt it was that. There were a few odd ways of getting NPEs in older versions of Friki, but there are none in the latest release that I'm aware of. My guess is that it is indeed someone who is faced with Null Pointer problems in their own code, and just wants to ask wherever he can for help. I agree it sounds like a good candidate for a FAQ; between us we must have answered null pointer questions a whole bunch of times in the forums.