- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
One issue with unboxing in Java that always throws exception #javaprogramming
In this video I uncover a subtle but potentially harmful issue related to unboxing in Java. If you've ever encountered a mysterious `NullPointerException` when working with object wrapper types and primitive types, this video is for you!
In Java, unboxing refers to the conversion of an object of a wrapper type to its corresponding primitive type. But what happens when that object has a null value? If you're not careful, this can crash your app with a frustrating `NullPointerException`.
Fortunately, Java 14 introduced helpful `NullPointerException` messages, making it easier to diagnose the issue. However, that doesn't prevent your app from crashing. In this video, I'll demonstrate with code examples what exactly goes wrong, and why it's an issue that you might overlook, even in your tests.
So, what's the best practice? Always check for null values before unboxing, or stick to primitives where possible for safety. I'll explain all of these and more.
If you want to navigate the tricky waters of Java's unboxing behavior safely, you won't want to miss this video. Make sure to hit the like and subscribe buttons to stay updated on all my future insights!
#javaprogramming #javalanguage #datastructures #datastructuresandalgorithms #programming #codingtips #softwareengineering #jre #jdk #jvm #npe #null #usa #america #nyc
Видео One issue with unboxing in Java that always throws exception #javaprogramming канала Sabyr | Daily Coding and DevOps Tips
In Java, unboxing refers to the conversion of an object of a wrapper type to its corresponding primitive type. But what happens when that object has a null value? If you're not careful, this can crash your app with a frustrating `NullPointerException`.
Fortunately, Java 14 introduced helpful `NullPointerException` messages, making it easier to diagnose the issue. However, that doesn't prevent your app from crashing. In this video, I'll demonstrate with code examples what exactly goes wrong, and why it's an issue that you might overlook, even in your tests.
So, what's the best practice? Always check for null values before unboxing, or stick to primitives where possible for safety. I'll explain all of these and more.
If you want to navigate the tricky waters of Java's unboxing behavior safely, you won't want to miss this video. Make sure to hit the like and subscribe buttons to stay updated on all my future insights!
#javaprogramming #javalanguage #datastructures #datastructuresandalgorithms #programming #codingtips #softwareengineering #jre #jdk #jvm #npe #null #usa #america #nyc
Видео One issue with unboxing in Java that always throws exception #javaprogramming канала Sabyr | Daily Coding and DevOps Tips
javaprogramming javalanguage datastructures datastructuresandalgorithms programming codingtips softwareengineering jre jdk jvm npe null java type unboxing java autoboxing and unboxing in java wrapper class in java autoboxing autoboxing in java wrapper class java wrapper classes wrapper classes java tutorial autoboxing and unboxing java autoboxing java nullpointerexception nullpointerexception java nullpointerexception fix java nullpointerexception catch usa america nyc
Комментарии отсутствуют
Информация о видео
31 августа 2023 г. 1:54:44
00:00:53
Другие видео канала





















