Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么对象类有 wait()、notify()、notifyAll() 方法。我们需要扩展 Thread 或实现 Runnable 以将类似 Thread 的行为赋予一个类。那么为什么 dint 将它们作为 Any of Thread 或
一个对象本身并不与线程相关联——它本质上只是虚拟机内存空间中的一些字段值和一个(子)类标识符。默认情况下,一个正在运行的 Java 应用程序的所有线程都可以使用一个对象。