BOOKJAVA Telegram 4060
Что произойдет, если поместить оператор return или System.exit () в блок try/catch?

Это очень популярный вопрос "на засыпку" по Java. Хитрость его в том, что многие программисты считают, что блок finally выполнится в любом случае. Данный вопрос ставит эту концепцию под сомнение, путем помещения оператора return в блок try/catch или вызова из блока try/catch оператора System.exit ().

Ответ на этот каверзный вопрос: блок finally будет выполняться при помещении оператора return в блок try/catch, и не будет выполняться при вызове из блока try/catch оператора System.exit ().

Мы в MAX

👉@BookJava
👍2



tgoop.com/BookJava/4060
Create:
Last Update:

Что произойдет, если поместить оператор return или System.exit () в блок try/catch?

Это очень популярный вопрос "на засыпку" по Java. Хитрость его в том, что многие программисты считают, что блок finally выполнится в любом случае. Данный вопрос ставит эту концепцию под сомнение, путем помещения оператора return в блок try/catch или вызова из блока try/catch оператора System.exit ().

Ответ на этот каверзный вопрос: блок finally будет выполняться при помещении оператора return в блок try/catch, и не будет выполняться при вызове из блока try/catch оператора System.exit ().

Мы в MAX

👉@BookJava

BY Библиотека Java разработчика


Share with your friend now:
tgoop.com/BookJava/4060

View MORE
Open in Telegram


Telegram News

Date: |

Earlier, crypto enthusiasts had created a self-described “meme app” dubbed “gm” app wherein users would greet each other with “gm” or “good morning” messages. However, in September 2021, the gm app was down after a hacker reportedly gained access to the user data. “[The defendant] could not shift his criminal liability,” Hui said. Select: Settings – Manage Channel – Administrators – Add administrator. From your list of subscribers, select the correct user. A new window will appear on the screen. Check the rights you’re willing to give to your administrator. Unlimited number of subscribers per channel Commenting about the court's concerns about the spread of false information related to the elections, Minister Fachin noted Brazil is "facing circumstances that could put Brazil's democracy at risk." During the meeting, the information technology secretary at the TSE, Julio Valente, put forward a list of requests the court believes will disinformation.
from us


Telegram Библиотека Java разработчика
FROM American