周末快乐
后天去和朋友搓麻将,直接虐杀他们!
明天公司还有年会,求一个一等奖
better tomorrow
实现Runnable,Callable接口,继承Thread类,使用Executor框架来创建线程池
1 | public class RunnableImpl implements Runnable{ |
1 | public class CallableImpl implements Callable<Integer> { |
1 | public class Mythread extends Thread{ |
1 | public class ThreadPoolExample { |
实现Runnable,Callable接口有哪些区别?
实现Callable接口能有返回值,而实现Runnable接口没有返回值