Quiz

Set aside your threads (in the Java sense, not the nudity sense), and answer the following questions about multithreading in Java.

Questions

1:What class must be implemented for a program to use threads?
  1. Runnable

  2. Thread

  3. Applet

2:If an interface contains three different methods, how many of them must be included in a class that implements the interface?
  1. None of them.

  2. All of them.

  3. I know, but I'm not telling.

3:You're admiring the work of another programmer who has created a program that handles four simultaneous tasks. What should you tell him?
  1. “That's not half as exciting as the Anna Kournikova screen saver I downloaded off the Web.”

  2. “You're the wind beneath my wings.”

  3. “Nice threads!”

Answers

A1: a. Runnable must be used with the implements statement. ...

Get SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.