943,739 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 397
  • Java RSS
Jun 23rd, 2009
0

null pointer exception problem

Expand Post »
Hello. I have come across a null pointer exception in my code. I understand this is got if there is no class/method/variable being referred to but in my case, I have a method in another class that is supposed to be called. However, the exception is thrown at the where I call it..
java Syntax (Toggle Plain Text)
  1. classB.getVar();
and this is the method skeleton in the class "classB"
java Syntax (Toggle Plain Text)
  1. public voidgetVar(){
  2.  
  3. }

Hope this can be helpful enough..I will post any more code if needed..
ps..Am not using actual method and class names for discretion purposes..
Similar Threads
Reputation Points: 19
Solved Threads: 20
Posting Whiz in Training
joshmo is offline Offline
280 posts
since Oct 2007
Jun 23rd, 2009
0

Re: null pointer exception problem

As you've been told on Sun, "classB" is null at that point.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Jun 23rd, 2009
0

Re: null pointer exception problem

thanks...checking it out
Reputation Points: 19
Solved Threads: 20
Posting Whiz in Training
joshmo is offline Offline
280 posts
since Oct 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Fast Lookups for Mobile Number Prefixes.
Next Thread in Java Forum Timeline: Class.forName(String ClassName) throwing ClassNotFoundException





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC