I think both of them will execute the thread task in some time in the future, why two methods?
Share
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.
Execute() doesn’t return a value, whereas submit() returns a Future that can be use to get the return value from the executed code.
execute() is there because it’s part of the Executor interface which ExecutorService extends, most likely only so there can be a very simple interface.