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..

classB.getVar();

and this is the method skeleton in the class "classB"

public voidgetVar(){
		
}

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..

Recommended Answers

All 2 Replies

As you've been told on Sun, "classB" is null at that point.

thanks...checking it out

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.