I have this C# code:
Action action = MyFunction;
action.BeginInvoke(action.EndInvoke, action);
which, from what I can tell, just runs MyFunction asynchronously. Can you do the same thing in Java?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is how you could run an action in its own thread in Java:
There are other higher-level frameworks available that give you more control on how things are run such as Executors, which can for example be used to schedule events.