Lesson 7. Exceptions and Threads
This lesson dives into two of Java’s most useful elements: threads and exceptions. Threads enable programs to make efficient use of resources by isolating the computing-intensive parts of a program so that they don’t slow down everything else. Exceptions enable programs to recognize errors and respond to them. Exceptions even make it possible for programs to correct the conditions and continue running, when possible.
Threads are objects that implement the Runnable interface or extend the Thread class to indicate that they can run simultaneously with other parts of a Java program. Exceptions are objects that represent errors that may occur as a Java program runs.
Exceptions are covered first in this lesson because ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access