来个正经的

来源:互联网 发布:sql partition by 编辑:程序博客网 时间:2024/06/11 14:41

发现之前写的文章都删除不掉,这个blog应该全都写技术内容才是啊。。。

现在开始要正经了呢。。。呵呵

 

1 what is the difference between abstract class and interface
An abstract class may contain code in method bodies, which is not allowed in an interface.
With abstract classes, you have to inherit your class from it and Java does not allow multiple inheritance.
On the other hand, you can implement multiple interfaces in your class.


2 What's the difference between the methods sleep() and wait()
A. The code sleep(1000); puts thread aside for exactly one second.
The code wait(1000), causes a wait of up to one second.
A thread could stop waiting earlier if it receives the notify() or notifyAll() call.
The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.

原创粉丝点击