I got some function I would like to use in multiple classes, what is the proper way to do that ?
I thought creating a class and set my functions to static... or maybe implement this class who need these functions ?
What do you think ?
Thanks
If this method does not use any instance variable of any object, it can (and probably should) indeed be made static, which makes it available from everywhere (provided it's also public).
Good examples of such stateless, globally available methods are the methods from the java.lang.Math class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With