YEAHUB_JAVA_BACKEND Telegram 250
#полезное
🤓 Java API Tip

Безопасное приведение long к int

Используй Math.toIntExact() — этот метод возвращает значение long, но выбрасывает ArithmeticException, если оно не помещается в int

Без него преобразование произойдёт молча — и ты можешь получить некорректный результат без всяких ошибок.

Используй toIntExact, когда важно контролировать переполнение

👉Новости 👉База вопросов
Please open Telegram to view this post
VIEW IN TELEGRAM



tgoop.com/yeahub_java_backend/250
Create:
Last Update:

#полезное
🤓 Java API Tip

Безопасное приведение long к int

Используй Math.toIntExact() — этот метод возвращает значение long, но выбрасывает ArithmeticException, если оно не помещается в int

Без него преобразование произойдёт молча — и ты можешь получить некорректный результат без всяких ошибок.

Используй toIntExact, когда важно контролировать переполнение

👉Новости 👉База вопросов

BY Java Backend | YeaHub




Share with your friend now:
tgoop.com/yeahub_java_backend/250

View MORE
Open in Telegram


Telegram News

Date: |

A Telegram channel is used for various purposes, from sharing helpful content to implementing a business strategy. In addition, you can use your channel to build and improve your company image, boost your sales, make profits, enhance customer loyalty, and more. Invite up to 200 users from your contacts to join your channel A new window will come up. Enter your channel name and bio. (See the character limits above.) Click “Create.” “Hey degen, are you stressed? Just let it all out,” he wrote, along with a link to join the group. Some Telegram Channels content management tips
from us


Telegram Java Backend | YeaHub
FROM American