We are not done with the chapter and we have learned how to write robust and correct programs. 2
In other words how to write reliable programs. 3
So let's go ahead and look at some of the important points we covered in this chapter the motivation 4
for learning exceptions is that no matter how carefully you write or programs a runtime we Mistal and 5
encounter exceptional situations like a partner solver Guangdong end programming such exceptional situations 6
are represented in the form of exceptions such exceptions happen when you do recover from them this 7
would be done using exception handling code. 8
So exceptions under exception handling code is what makes the software robust. 9
Otherwise the software would be considered for fraudulent injera an exception is simply an object of 10
the class. 11
Drawable are one off its subprocess it program can generate two types of exceptions checked on unchecked 12
on this table describes these two types of exceptions to the exception should be thrown in only exceptional 13
situations that are not in our control and these exceptions are checked by the compiler. 14
That is a compiler checks that they are either handled by the invoking court order invoking code propagates 15
them to its own calling code by indicating them in the method declaration a checked exception can be 16
an instance of drawable are one off a subprocess but with the exception of a runtime exception class 17
or the adder class coming to unshipped exceptions they're generally genitor either programming false 18
or some abnormal conditions like internal system errors that are usually GBM related compiler does not 19
check unchecked exceptions. 20
That is a compiler does not check whether they are part of the method declaration or whether they are 21
even handled by the invoking or unchecked exceptions are also generally not are these exceptions are 22
instances of either an exception class or a class or one off a process unhittable steps for generating 23
exceptions they can be undeterred by methods or even constructor's First up is to create an exception 24
object. 25
And second step is to grow that exception object via trusted. 26
And the final step is to indicate that in the truest clause of the modern declaration on this final 27
step is mandatory. 28
What tipped exceptions exception handling involves using Cricut block or the method can simply propagate 29
an exception via its own throws across and we can also have a finally block if we want to run some code 30
regardless of whether or not an exception is generated typically It includes the clean code. 31
And the finally block is an optional block. 32
Not that the block must be accompanied by at least one catch block or finally block. 33
Finally believe that assertions which help in writing correct programs so well exceptions help with 34
robustness assertions help with correctness of the programs and in terms of benefits. 35
Assertions are very effective in quickly detecting bugs during development time moreover they also saw 36
as documentation one particular item recommended doing unshipped exceptions for public matters when 37
there are any precondition violations for nonpublic matters it recommended using sessions which should 38
help in detecting any bugs or documenting that. 39
In other words detecting any wrong is options we also know that several effective dollar items. 40
I think except for one become are all the exception related items from the book we also implemented 41
all of the ones that we see here. 42
Restaurants is use checked exceptions for regrettable conditions on unchecked exceptions. 43
What programming inners Second chances don't ignore exceptions by using empty catch blocks. 44
Remember that an exception is like a fire alarm. 45
So you should try to handle that. 46
Third one is about capturing as much information as possible. 47
When an exception is generated information such as all the relevant barometer values and even food values 48
can be included. 49
It's a very useful method to fix bugs unfought one was about exception translation an exception. 50
Chaining on here are a few more items that we covered which are more like tips. 51
First one here recommends not to use exceptions for Punggol second one suggest not to carelessly use 52
techniques or options as the bliss extra burden on the API client as they're forced to handle them 31 53
recommends using standard exceptions as that would make your API easier to understand. 54
55 12:56 recommends good document on exceptions that are to those and that includes Boucek as well as object 56
not add the item also suggests not to declare and Tippex opinions in the cross-class. 57
So you would only document them but not declare them. 58
It hurts the reader of your code to easily distinguished checked exceptions from unchecked we only do 59
it because the final one also noted the supplementary notes was included with some of the lessons that 60
covered effective dollar items and does not include some of the deep points covering those items so 61
you can use that material as a reference and that's about it we have learned about the tools we need 62
for writing reliable software. 63
Thanks for listening and good bye for now.