Experienced Java interview question | #1

preview_player
Показать описание
Java interview questions for beginners and experienced

#java
#javaprogramming #javatutorial
#javaquestions
Рекомендации по теме
Комментарии
Автор

In Java, Integer is also have pool like concept which is called cached it do have inclusive range of - 128 to +127 so first two variables are out of cache range so it would have two different references over there in object pool but when comes to next two variables there value is falling on cache range so it won't create duplicate object instead it would use cached object and both variables are referring to that object. ❤❤

karriprakash
Автор

because Integer also have a pool like String you can say it is some way immutable

yqzuhkc