<T> Future<T> submit(Callable<T> task);
<T> Future<T> submit(Runnable task, T result);
Future<?> submit(Runnable task);
void execute(Runnable command);
1)二者参数不同
2)submit有返回值,execute无返回值
<T> Future<T> submit(Callable<T> task);
<T> Future<T> submit(Runnable task, T result);
Future<?> submit(Runnable task);
void execute(Runnable command);
1)二者参数不同
2)submit有返回值,execute无返回值
本文标题:线程池submit和execute方法的区别
本文链接:https://www.haomeiwen.com/subject/qvvyuhtx.html
网友评论