Java Programming Tutorial & Training  /  Business Courses

Test Prep Plan - Take a practice test

Take this practice test to check your existing knowledge of the course material. We'll review your answers and create a Test Prep Plan for you based on your results.
How Test Prep Plans work
1
Answer 50 questions
Test your existing knowledge.
2
View your test results
Based on your results, we'll create a customized Test Prep Plan just for you!
3
Study smarter
Study more effectively: skip concepts you already know and focus on what you still need to learn.

Java Exceptions Chapter Exam

Exam Instructions:

Choose your answers to the questions and click 'Next' to see the next set of questions. You can skip questions if you would like and come back to them later with the yellow "Go To First Skipped Question" button. When you have completed the practice exam, a green submit button will appear. Click it to see your results. Good luck!

Page 1

Question 1 1. What is a 'Stack Trace'

Question 2 2. In the following stack trace, which line number refers to the place where nested exception was thrown?

Question 3 3. What are the possible arguments to an Exception constructor?

Question 4 4. How many levels of nesting are allowed with nested Exceptions?

Question 5 5. Which keywords do you need to use when nesting exceptions?

Page 2

Question 6 6. Code that catches an exception and performs other code is called a(n) _____

Question 7 7. Which of the following code samples will create an exception in Java?

Question 8 8. Which of the following exceptions will occur if you try to reference an index of an array that doesn't exist?

Question 9 9. Examine the following code. What will happen if the file myfile.txt is not found?

Question 10 10. Java keeps a list of exceptions and will know what exception has occurred. Where are these stored?

Page 3

Question 11 11. An _____ is also known as an error.

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

Question 13 13. Consider the code snippet below. What outcome would the user see when running this code?

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

Question 15 15. A type of error that is caught before Java code is even run is a(n) _____.

Page 4

Question 16 16. Multiple exceptions can be caught using _____

Question 17 17. You are writing code to catch multiple exceptions, but the compiler shows this error. What does it mean?

Question 18 18. Examine the following code. Which of the following catch blocks makes most sense for this example?

Question 19 19. Exceptions are stored in classes and subclasses of which main Class?

Question 20 20. Which of the following correctly catches two exceptions?

Page 5

Question 21 21. Which of the following is the correct way to formulate the try and catch statements?

Question 22 22. In Java, an exception is a(n) _____

Question 23 23. If a compiler displays an exception error, this exception is considered _____

Question 24 24. The following code will compile and run. What type of exception would occur if the user updated the value of the variable b to 0?

Question 25 25. Exceptions that occur when the program runs are called _____ exceptions

Java Exceptions Chapter Exam Instructions

Choose your answers to the questions and click 'Next' to see the next set of questions. You can skip questions if you would like and come back to them later with the yellow "Go To First Skipped Question" button. When you have completed the practice exam, a green submit button will appear. Click it to see your results. Good luck!

Support