Nathan Kreider Nathan Kreider - 8 months ago 49
Java Question

Calling method without object

I have built a small (and 3 methods only!) api for myself, and I want to be able to call it like how you would call a method in Powerbot (A Runescape botting tool (I use it, but for programming purposes, not for actual cheating purposes)), without creating an Object of the file you'd require. How would i be able to do this?

Answer Source

if you use the static keyword when importing your class, you can use it's methods as if they belong to the class you're importing them to

and of course your "api methods" need to be static as well