Usages of listener in user task

what is the use of having assigned java class in Execution listener and task listener?
please check the screenshot.

as per documentation

Execution Listeners can be attached to any event within the normal token flow, e.g., starting a process instance or entering an activity.
Task Listeners can be attached to events within the user task lifecycle, e.g., creation or completion of a user task.

So task listeners are for interacting with the user task events and exec listeners with execution events, i would assume that in the user task example, user task listeners will take place between exec listeners.

so I have one user task and on that a group is assigned so that all the users of that group will be assigned with task to complete means each users is assigning with one taskid and i want to complete the user task once any two user will complete the task.
and that i am trying to do using java so that i can check in java if any two user’s taskid has completed status in database table,all other user’s taskid will be updated with completed status.

check this, maybe it will be simpler to use user task multiple instance together with completionCondition.