Solved How to fire a method from a class without using a variable?

Discussion in 'Plugin Development' started by Jaker232, Jan 22, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Jaker232

    Is it possible for me to trigger a method from a class (for example: main class) without having to pass it to the constructor and store it in a variable? The reason why I do not want to store it in the variable is because I want to cut down on memory usage from the plugin itself, since I'm using a class to store stuff, and when there's like hundreds of them, it can chew through memory because it's accessing a rather large class which requires more memory than a smaller class.
     
  2. Offline

    Rocoty

    I think you might be missing the way in which variables work. They do not contain a copy of the class itself. They contain a reference to the instance of the class. Think of the variable as a remote control for the class instance. I think you will be just fine memory wise.
     
  3. Offline

    Jaker232

    Alright, thanks for clarifying! I'm just hopping back into Java programming.
     
Thread Status:
Not open for further replies.

Share This Page