"cannot make a static reference to the non-static method"?

I hope this is the right place for this question.

I just finished writing all the code for the classes I need for my project but now I'm having trouble putting them together.

How do I address this error? My web search led to a forum where someone just linked the tutorial on objects but I have the learning processing book and I reread that chapter twice.

Apparently, my method is non-static but you can only make "static references" in draw?

What does that even mean? I just want to put my code into classes to make it readable.

Thanks for any help.

Tagged:

Answers

  • edited November 2017 Answer ✓

    "Cannot make a static reference to the non-static method..." means you're trying to invoke a method using its actual class name instead of via an instance reference (generally stored in variables). [-X

    Look up the dot . deference operator: https://Processing.org/reference/dot.html *-:)
    And also the keyword new operator: https://Processing.org/reference/new.html ~O)

  • edited November 2017

    you're trying to invoke a method using its actual class name>

    Thank you!! The simplest explanation I've heard.

    The error is cleared up. Now I just have to figure out why I have a NullPointerException.

    -_-

Sign In or Register to comment.