Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
stackoverflow-Java-top-qa
stackoverflow-Java-top-qa
=======================
对stackoverflow上Java相关、投票数TOP100的问答进行翻译,欢迎点star,我们会持续更新!!!

Expand Down Expand Up @@ -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)

> 网络

Expand Down Expand Up @@ -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)
Expand Down
23 changes: 23 additions & 0 deletions contents/implements-runnable-vs-extends-thread.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
##ʵ��Runnable�ӿ� VS. �̳�Thread�� ��

��Java�У�����ִ������һ�������ַ�ʽ��
��1��ʵ��Runnable�ӿ�
��2���̳�Thread��

һ����ԣ��Ƽ�ʹ�÷�ʽ��1��,��Ҫ�����ڴ��������£����Dz������ر�ȥ��ע�̵߳���Ϊ��Ҳ����ȥ��дThread���е���Ϊ�򷽷�������������ִ��������ѡ�
��ˣ�ʹ�ýӿڵķ�ʽ�ܱ�������һЩ������Ҫ�Ķ�����ͬʱҲ����Ӱ��̳������࣬��ʹ���������


###�����tips��
��1��Runnable��Thread���ǶԵȵĸ���
��Thinking in Java�У������²۹�Runnable���������������Task��Ϊ������
��Java�У�Runnableֻ��һ��������������Ĵ���ζ��ѣ��Ǿ�̬�ĸ����Ҫͨ���߳���ִ�С���Thread������һ�����壬�����;��кܶ���Ϊ���ܹ�����ִ������

��2����������ȷʵ��Ҫ��д��override��һЩ������Ϊʱ����ʹ�ü̳У�������ʹ�ýӿڡ�

��3����Java 5֮ǰ��������Threadȴû������start()���������ܵ����ڴ�й¶��


stackoverflow���ӣ�
http://stackoverflow.com/questions/541487/implements-runnable-vs-extends-thread