O'Reilly logo

Java, A Beginner’s Guide, 5th Edition by Herbert Schildt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11: Multithreaded Programming

1. How does Java’s multithreading capability enable you to write more efficient programs?

Multithreading allows you to take advantage of the idle time that is present in nearly all programs. When one thread can’t run, another can. In multicore systems, two or more threads can execute simultaneously.

2. Multithreading is supported by the __________ class and the __________ interface.

Multithreading is supported by the Thread class and the Runnable interface.

3. When creating a runnable object, why might you want to extend Thread rather than implement Runnable?

You will extend Thread when you want to override one or more of Thread’s methods other than run( ).

4. Show how to use join( ) to wait for a thread ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required