+ 2
Explain me? please...
my java code's Output make me more confused. please ! Run the code and explain me. https://code.sololearn.com/cicvDNP7CAYQ/?ref=app
5 Answers
+ 3
Like what Ali said..
If you use integer type then the value will become an object it gets wrapped so you can call methods on it.
Behind the scenes with integer when you compare variables/refreneces that have the same value it works "similar" to how duplicate strings work in string pool instead of creating the same value again it will use an existing one so therefore they share the same refrenece.
integer x = 100;
integer y = 100;
these both refer to the same value.
+ 3
~ swim ~ exactly đ i couldn't remember the range I wonder why they didnt just store it as a string and just convert it afterwards because this is somthing you wouldent know unless you seen the source code đ¤
+ 2
Don't write "Integer", write "int".
+ 1
if ( (int) num3 == (int) num4 ) {
+ 1
nice