You must create an object if you need initialization, for example, it is possible to get values ββor parameters from a data source.
Staticity is the way to go in your example, since they are an atomic function that always returns the same result, regardless of context (idle)
However, in C # (I don't know in java), there is a better way: extension methods. Basically, you will add a method to the string object that will allow them to be called directly on the string object, and if the yor return object is also a string, bind them if you need:
public static string reverse(this string str) {
For more information: https://msdn.microsoft.com/en-us/library/bb383977.aspx
Remy grandin
source share