I Cannot Make A Static Reference To The Non-static Method. But Why?

Asked By 0 points N/A Posted on -
qa-featured

I am currently using Java to make a cross-platform application interface. I want to debug all of my errors during compilation. One of the errors generated during compilation says that the system cannot make a static reference to the non-static method. What are the possible reasons?

SHARE
Answered By 0 points N/A #292879

I Cannot Make A Static Reference To The Non-static Method. But Why?

qa-featured

You must be calling a function which is static through a non-static method. Instances or non-static methods are only applied on particular class objects. They are instantiated only once. You can remove the ‘static’ keyword from your function. The two do no work together and rather operate on different data spaces. Moreover, there is no requirement to do this. Instead, you may pass a ‘context’ for other classes and call this context into other classes.

Related Questions