2016年11月21日
摘要: 转自:http://blog.csdn.net/ghsau/article/details/7451464 本篇说明的是Callable和Future,它俩很有意思的,一个产生结果,一个拿到结果。 Callable接口类似于Runnable,从名字就可以看出来了,但是Runnable不会返回结果,并 阅读全文
posted @ 2016-11-21 21:36 navyhj 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.chinaitlab.com/Java/line/942440.html 编写多线程程序是为了实现多任务的并发执行,从而能够更好地与用户交互。一般有三种方法,Thread,Runnable,Callable. Runnable和Callable的区别是, (1)Calla 阅读全文
posted @ 2016-11-21 21:33 navyhj 阅读(713) 评论(0) 推荐(0) 编辑
摘要: 转自 http://auguslee.iteye.com/blog/1292335 Callable 和 Runnable 的使用方法大同小异, 区别在于: 1.Callable 使用 call() 方法, Runnable 使用 run() 方法 2.call() 可以返回值, 而 run()方法 阅读全文
posted @ 2016-11-21 21:30 navyhj 阅读(239) 评论(0) 推荐(0) 编辑