How get the activity id of task by java api?

The Task object have not provided the method of get the task activity id.

How can i get it ? It is so important to me.

Look https://docs.camunda.org/javadoc/camunda-bpm-platform/7.9/org/camunda/bpm/engine/task/Task.html#getId()

What API are you using?
When you say “task activity id” what do you mean exactly - what do you need this id for?

Thank you but this is not actully what i need.

I just want to know the task belong to which activity.
And I want to get the activity id by use java api

My apologies. My english not so good.

I just want to know the task of from camunda is belong to which activity.
And I want to get the activityId by use java api.

@Niall
@scepbjoern

Tanks you all.
I already get the java api
Here is the name of the api

getTaskDefinitionKey

You can get like below also

To get activityId given processInstanceId

processEngine.getRuntimeService().getActiveActivityIds(caseInstanceId)