The last step is to bulletproof the application, in other words, working to make sure the application
doesn't fail or crash no matter what.
All right, let's run the up.
And the first vulnerability in the opposite, the user enters a blank name or phone number.
The constructor is going to throw in a legal argument exception once again, this is an unchecked exception
because it occurs during the runtime, but under no circumstance should be let the application crash.
If we get an unchecked exception, that means there's something wrong or there's something missing in
your code.
And what's missing in this case is code that anticipates a scenario where the user may enter a blank
name or phone number, so we'll say if name DOT is blank or if the number they pass on is blank.
Then we'll just print the input you provided is not valid registration, fáilte.
Otherwise, we can add the contact.
If you run the app.
Good.
But another illegal argument exception crashes the app if the user enter the phone number, that's less
than five characters.
Once again, an unchecked exception implies we're missing something in the code.
And all we gotta do is check if the phone number is less than five characters, then we're going to
tell the user that their input is not valid.
And with this final line of code, proud to say that we're all finished.
Just like that, our application is bulletproof, no matter what the user throws at you, the application
is free of bugs and it's never going to crash.
It can process any input and respond accordingly.
In the end, exception handling, which involves catching checked exceptions and fixing unchecked exceptions,
is the key to building bulletproof applications.