I have a function, which sends a message to a Server, and another function which would be called if the answer arrives. So I want to return the parameter of the recive function in the request function. How can I do this ?
private Answer request(User user){
//perform request
//wait for answer but how
}
public void recive(Answer answer){
//I want the answer parameter
}