Post

🌒 Eclipse IDE
🌒 Eclipse IDE@EclipseJavaIDE·
What will be the output of this program? (don't cheat!)
🌒 Eclipse IDE tweet media
English
72
44
167
0
🌒 Eclipse IDE
🌒 Eclipse IDE@EclipseJavaIDE·
As a follow up try with i1 = 3, i2 =3
English
3
0
8
0
🌒 Eclipse IDE
🌒 Eclipse IDE@EclipseJavaIDE·
It has nothing to do with object reference vs value comparison. Would have been too easy ;)
English
1
1
4
0
🌒 Eclipse IDE
🌒 Eclipse IDE@EclipseJavaIDE·
Answer is False because of the caching mechanism trick of Integer. Read through the answers of those who got it.
English
1
1
4
0
Tagir Valeev
Tagir Valeev@tagir_valeev·
@EclipseJavaIDE Wrong, of course. The correct answer: according to the JLS 5.1.7 the result of this program is unspecified. #jls-5.1.7" target="_blank" rel="nofollow noopener">docs.oracle.com/javase/specs/j…
Tagir Valeev tweet media
English
0
0
2
0
Paylaş