Java for Beginners 15 - Checked and Unchecked Exceptions

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Check out the newest episode of my free java video course where I talk about the history of exceptions, discuss Checked- and Unchecked Exception, show lots of examples and give some clean coding advice on how to properly do exception handling in Java...

MarcusBiel
Автор

When you check that String can be parsed to CarState, would it be better to pass parsed value to process method? I don't understand why you validate the input, know what the correct enum value is, but pass String to process method. That means you are doing parsing in two places which can get out of sync (say you do case insensitive comparison in one place but not in the other)

milmarcin
Автор

Hi, I watched the whole video, I would sum it up like this: There are two kind of exceptions. 1 exceptions that you know may occur at some time, but if you know that they can occur it would be better to handle them before they occur(ie. validate the data first), so in the end there would be no reason of using try and catch.
2 exceptions that occur on runtime (The ones that we do not know when and how they can occur) in this case it will be useful to use try and catch but only in the sense of discovering what the error is.
Is this correct?
Greetings from Mexico City!!
Thanks for your efforts!

adriansalabanzi
Автор

I liked the video, but everybody seems to have "java for beginners".
There are only a few who show more advanced videos. :(

theodoro
Автор

its already watched but i need single sentence anser

harishchowdarysure