#6 Java Exception Handling Understanding Finally Blocks Clearly

Описание к видео #6 Java Exception Handling Understanding Finally Blocks Clearly

That is divided by 0 But see it is the end of word uh catch block Now I enter into which block That is a finally block Now see inside the finally block I just write here that is fine system dot out dot that is a println I just write here that is a please enter that is a command line argument Please enter command line arguments That is end of the finally block end of the that is the main end of the class See Java tell if exception arise then the catch block executed So if exception arise then this line never be executed it print reason is divided by 0 then print please enter command line argument If exception not arise I write I enter hello They go if I write here Java there it is When I write Java x no command line argument is there Then exception arise When the exception arise the catch block executed reason is divided by 0 Then what it print Finally block must be executed Please enter the command line argument But if I write java x here I write hello When I enter your hello that is y is one hundred by one is 100 No exception is generated So the catch block never be executed But the finally block must be executed What it write

Комментарии

Информация по комментариям в разработке