Thread类 定义了一些对线程管理十分有用的的方法。The Threadclass defines a number of methods useful for thread management.The following are the methods of the Thread class . Thread类 本身是实现Runnable,虽然它的run方法啥都没干。The Threadclass itself implements Runnable, though its runmethod does nothing.Thread类 定义了一些对线程管理十分有用的的方法。The Thread class defines a number of methods useful for thread management.
Following is the list of important medthods available in the Thread class . Sleep()方法是Thread类 里面的一个静态方法。 Sleep(): It is a static method on Thread class . Sleep is a static method of the Thread class . 下面ThreadClassDemo程序演示了一些Thread类 的这些方法。 Example The following ThreadClassDemo program demonstrates some of these methods of the Thread class . Animationthread类 为游戏逻辑更新DrawablePanel,并使控制板进行重塑。 The animation thread class updates the DrawablePanel for game logic and forces a redraw of the panel. Thread类 的stop()方法同样在Java2中受到反对。The stop() method of Thread class , too, was deprecated by Java 2. Sleep不会创建一个新线程,sleep是Thread类 的静态方法,用于暂停当前线程的活动。 Sleep does not create a new threadsleep is a static method of the Thread class that temporarily stops the activity of the current thread. . 这个对那些扩展Thread类 或者实现Runnable接口的对象特别重要。 This has special importance in those objects that extend the Thread class or implement the Runnable interface. Thread类 的stop()方法同样在Java2中受到反对。The stop() method of the Thread class was also deprecated by Java 2. 为什么wait,notify和notifyAll是在Object类中定义的而不是在Thread类 中定义? Why wait, notify, and notifyall methods are defined in the Object class, and not in the Thread class ? 为了达到这个目的,我们使用Thread类 的join()方法。 For this purpose, we can use the join() method of the Thread class . 实现Runnable接口这种方式更受欢迎,因为这不需要继承Thread类 。 The Runnable interface is preferred, as it does not require an object to inherit the Thread class . Runnable接口是首选的,因为它不需要对象继承Thread类 。 The Runnable interface is preferred, as it does not require an object to inherit the Thread class . Wait方法是Object类的方法,sleep方法是Thread类 的方法。 Ans 1 wait() is a method of Object class. sleep() is a method of Thread class . Thread类 的stop()方法同样在Java2中受到反对。The suspend() method of the Thread class was deprecated by Java 2.Java的多线程系统建立于Thread类 ,它的方法,它的共伴接口Runnable基础上。 Java's multithreading system is built upon the Thread class , its methods, and its companion interface, Runnable. 为达此目的,我们使用Thread类 的join()方法。 For this purpose, we can use the join() method of the Thread class . 可以将优先级设置为MIN_PRIORITY(在Thread类 中定义为1)与MAX_PRIORITY(定义为10)之间的任何值。 You can set the priority to any value between MIN_PRIORITY(defined as 1 in the Thread class ) and MAX_PRIORITY(defined as 10). Each thread is associated with an instance of the class Thread . 为什么wait,notify和notifyAll这些方法不在thread类 里面?? Why wait, notify, and notifyall methods are defined in the Object class, and not in the Thread class ? Which of the following are the methods of the Thread class ? Sleep() is a method of Thread class . 继承Thread类 还是实现Runnable接口?? Sub class of Thread or implementation of Runnable interface? The following methods in the Thread class are static.
Display more examples
Results: 50 ,
Time: 0.0172