I want to write a general function for my project that will be used across many different files and I don’t want to have it in a particular class.
Where am I supposed to put it?
Inside a new package as a class?
Is this the only option?
Create a new package as util and create all common methods in there, for example:
Create package as
Create a class as
Util in above package.
Then write your all common methods in this
You can write static methods in this class and access them as
Answered By – Bishan
Answer Checked By – Marie Seifert (BugsFixing Admin)