Learn Java Programming - Exceptions: Multi-catch Tutorial

Опубликовано: 16 Сентябрь 2015
на канале: Daniel Ross
710
4

There will often be occasions where you may need to catch more than one exception. You can have multiple catch statements with each one specifying a single exception class and then a code block for handling the exception. This could lead to a lot of redundant code. With a multi-catch statement you can catch multiple exceptions in the same statement.
A multi-catch statement looks like this:
catch ( NullPointerException | IndexOutOfBoundsException | InvalidArgumentException e) { ... }


На этой странице сайта вы можете посмотреть видео онлайн Learn Java Programming - Exceptions: Multi-catch Tutorial длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Daniel Ross 16 Сентябрь 2015, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 710 раз и оно понравилось 4 зрителям. Приятного просмотра!