CJCoding With Joseph
15free / daySign inCreate account

Thompson Rivers University

Question 4

Lab 3 Exceptions - SM 2025

What would happen if the try statement described in the previous exercise were moved to the level2 method instead?


Short Answer

If the try block is moved to level2() instead of being in level1(), then level2() will catch the exception caused by level3(), and level1() won’t have to deal with it. The program will still run and the error will be handled, but just in a different place.

Members only

Keep reading this lesson

You've reached the end of the free preview. Unlock the rest of this lesson plus 54 more lessons in Thompson Rivers University.

  • Unlimited coding questions
  • Unlimited access to all classroom material
  • Weekly live call for questions and guidance
  • 3,000 AI tutor tokens / month
  • Personal SQL database (3 MB)
  • Progress tracking

Cancel any time.