How to pass output from one service task to other service task

I am new to Camunda BPMN tool. I am trying to pass some output values from one service task to other service task. Here i can able to call java class from service task and able to run the program but the program output is displayed on command prompt. I need to pass the output values to other service task to continue the flow. If there is any suggestions means please let me know

You can store any relevant output in process variables.
These process variables are accesible in the upcoming service tasks.
Have a look at the documentation
or the camunda examples

thank you @tim_kraeuter