In Java, the == operator compares object references, not values. Java caches Integer objects for values between -128 and 127, so when two Integer variables are assigned values within this range, they reference the same cached object and == returns true. However, for values outside this range (like 128), new Integer objects are created for each assignment, resulting in different references and causing == to return false. This is why Integer a = 128, b = 128; a == b evaluates to false.
Inmersión profunda
Prerrequisito
- No hay datos disponibles.
Instala nuestra extensión para buscar dentro de cualquier video al instante
Próximos pasos
- No hay datos disponibles.
Inmersión profunda
Java Integer Caching: The == Operator MysteryAñadido:
Does integer a equals 128, b equals 128, a equals b evaluate to true?
A, true. B, compilation error.
C, null pointer exception. D, false.
The correct answer is D, false.
Execute system.out.println like [music] run mvn install dev logic quiz to subscribe and scanner not next line your answer below.
Videos Relacionados
resume fixed instantly 😭 Comment “app”andI’ll sendyou the link #parakeetaipartnership #resumetips
Ritcareer
686 views•2026-05-31
Re: 🗣️📍theprophedu📍2026 GST 103 CLASS (E-EXAM REVISION)
theprophedu
636 views•2026-06-04
3D Basics in C
HirschDaniel
2K views•2026-06-05
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
Making Minecraft Clone with C++ & Raylib
PecaCSLive
686 views•2026-06-04
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Instagram accounts got PWNed
EricParker
13K views•2026-06-03
So What's Odin Lang Even Good For
TechOverTea
131 views•2026-06-01











