首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

线程stop的时分,显示The method stop() is deprecated会有什么后果

2012-09-28 
线程stop的时候,显示The method stop() is deprecated会有什么后果?如下代码所示,在用stop结束线程时,stop

线程stop的时候,显示The method stop() is deprecated会有什么后果?
如下代码所示,在用stop结束线程时,stop被横线划掉了。而且报这个警告The method stop() from the type Thread is deprecated。会对线程的执行有影响吗?

Java code
        tran_input = new Thread(new ActTranIn());        tran_input.start();                /**执行SSLSocket接受数据的代码。。。省略**/        tran_input.stop();            class ActTranIn implements Runnable {                public void run() {                          /**执行SSLSocket发送数据的代码。。。省略**/                        }                }


[解决办法]
http://blog.csdn.net/DLite/article/details/4212915
[解决办法]
会执行的 你可以不用管警告
[解决办法]
Thread.stop()有bug的,有时候抛出运行时异常。所以不见意用这个方法。

热点排行