Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed C# Objects!
You have completed C# Objects!
Preview
Learn the ins and outs of catching exceptions and what all this has to do with inheritance.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
We already have a try catch
block in the main method
0:00
that's catching system.exception.
0:01
As this code is written right now
this catch block will handle any and
0:03
all exceptions that are thrown from
the code inside the try block.
0:08
If a TreehouseDefense exception gets
thrown, this block will handle it.
0:12
Even the out of bounds exception
will get caught and handled here.
0:17
In fact,
if any other exception type is thrown,
0:21
it will still be caught
by this catch block.
0:24
We're not yet handling different
types of exceptions differently.
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up