Handling Exceptions in Java: Try & Catch

Instructions:

Choose an answer and hit 'next'. You will receive your score and answers at the end.

question 1 of 3

If an error occurs when code inside a try block runs, what will happen next?

Create Your Account To Take This Quiz

As a member, you'll also get unlimited access to over 79,000 lessons in math, English, science, history, and more. Plus, get practice tests, quizzes, and personalized coaching to help you succeed.

Try it risk-free
Try it risk-free for 30 days. Cancel anytime
Already registered? Log in here for access

1. An _____ is also known as an error.

2. Why might you want to place your Java code in a try block with a catch block after?

Create your account to access this entire worksheet
A Premium account gives you access to all lesson, practice exams, quizzes & worksheets
Access to all video lessons
Quizzes, practice exams & worksheets
Certificate of Completion
Access to instructors
Create an account to get started Create Account

About This Quiz & Worksheet

This quiz and worksheet will ask you about try/catch blocks in the Java programming language. Through a handful of multiple-choice questions, you'll be challenged to identify the purpose of these blocks and what happens if errors occur inside them.

Quiz & Worksheet Goals

To pass the quiz, you'll be required to:

  • Determine what happens after an error occurs inside a try block
  • Provide another name for an error
  • Tell why you'd want to follow a try block with a catch block
  • Look at a piece of example code and select the outcome
  • Identify the type of error that's caught before Java code is run

Skills Practiced

You'll get practice applying the following skills:

  • Knowledge application - use your knowledge to answer questions about catch blocks, try blocks and the different types of errors in Java
  • Information recall - access the knowledge you've gained regarding the Java error that happens inside a try block
  • Making connections - know what a Java error is also known as

Additional Learning

Handling Exceptions in Java: Try & Catch is a related lesson that goes into detail about this Java topic. After studying the lesson, you should be able to:

  • Analyze a try/catch example
  • Understand what try/catch blocks help programmers do
  • Tell what a user would see in an example Java code
Support