How can we handle multiple instances of a method through a single class instance(Single constructor call)?
To elaborate, I have a handler class which has two methods lets say verifyUser(String JSON)
and getUserInfo(String JSON)
. Assuming that there are many users accessing this methods, there will be multiple instances of these methods. The handler class should be initialized once. I.e. multiple objects of this class are not permitted, rather multiple method instances are allowed.
What will be the ideal solution for enabling concurrent method calls without corrupting data while executing?