diff --git a/README.md b/README.md index a54c7e3..55bdb03 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -stackoverflow-Java-top-qa +stackoverflow-Java-top-qa ======================= 对stackoverflow上Java相关、投票数TOP100的问答进行翻译,欢迎点star,我们会持续更新!!! @@ -37,6 +37,7 @@ stackoverflow-Java-top-qa * [去掉烦人的“!=null"(判空语句](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/avoiding-null-statements-in-java.md) * [获取完整的堆栈信息](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/get-current-stack-trace-in-java.md) * [如何通过一行代码初始化ArrayList](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/initialization-of-an-arraylist-in-one-line.md) +* [实现Runnable接口 VS. 继承Thread类](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/implements-runnable-vs-extends-thread.md) > 网络 @@ -64,7 +65,6 @@ stackoverflow-Java-top-qa - [How to avoid Java code in JSP files?](http://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files) - [Why is executing Java code in comments with certain Unicode characters allowed?](http://stackoverflow.com/questions/30727515/why-is-executing-java-code-in-comments-with-certain-unicode-characters-allowed) - [Dealing with “java.lang.OutOfMemoryError: PermGen space” error](http://stackoverflow.com/questions/88235/dealing-with-java-lang-outofmemoryerror-permgen-space-error) -- [“implements Runnable” vs. “extends Thread”](http://stackoverflow.com/questions/541487/implements-runnable-vs-extends-thread) - [Convert a String to an enum in Java](http://stackoverflow.com/questions/604424/convert-a-string-to-an-enum-in-java) - [Android SDK installation doesn't find JDK](http://stackoverflow.com/questions/4382178/android-sdk-installation-doesnt-find-jdk) - [Initialization of an ArrayList in one line](http://stackoverflow.com/questions/1005073/initialization-of-an-arraylist-in-one-line) diff --git a/contents/implements-runnable-vs-extends-thread.md b/contents/implements-runnable-vs-extends-thread.md new file mode 100644 index 0000000..57e1863 --- /dev/null +++ b/contents/implements-runnable-vs-extends-thread.md @@ -0,0 +1,23 @@ +##ʵRunnableӿ VS. ̳Thread + +JavaУִһַʽ +1ʵRunnableӿ +2̳Thread + +һԣƼʹ÷ʽ1,Ҫڴ£Dzرȥע̵߳ΪҲȥдThreadеΪ򷽷ִѡ +ˣʹýӿڵķʽܱһЩҪĶͬʱҲӰ̳࣬ʹ + + +###tips +1RunnableThreadǶԵȵĸ +Thinking in JavaУ²۹RunnableTaskΪ +JavaУRunnableֻһĴζѣǾ̬ĸҪִͨ߳СThreadһ壬;кܶΪִܹ + +2ȷʵҪдoverrideһЩΪʱʹü̳Уʹýӿڡ + +3Java 5֮ǰThreadȴûstart()ܵڴй¶ + + +stackoverflowӣ +http://stackoverflow.com/questions/541487/implements-runnable-vs-extends-thread +