Post

🌒 Eclipse Java IDE
🌒 Eclipse Java IDE@EclipseJavaIDE·
Answer here is True! Most of the times the == comparison will be False (many people thought this was too easy ;) but also read up on string interning!
English
1
1
12
0
Jack B
Jack B@JackInTheBox747·
@EclipseJavaIDE True, no use of new String, so "Hello" will be placed once into String Pool, both references refer to same object "Hello"
English
0
0
16
0
Ahmad Floos
Ahmad Floos@f1oos·
@EclipseJavaIDE False, because the equalty here looking in the reference addresses in the memory not to the content 😉
English
0
0
7
0
Minecraft News (DACH)
Minecraft News (DACH)@MC_News_Germany·
@EclipseJavaIDE True because the strings share the same memory adress. So even though you dont use „equals“ it will result in true
English
0
0
1
0
sheshavi
sheshavi@sheshavi2·
@EclipseJavaIDE answer is false because it refers storage location,there is no two objects share same memory
English
0
0
0
0
Aidan
Aidan@aidanD1981·
@EclipseJavaIDE True. The first one checks the string pool for a match, creates and interns the string if it doesn't find one. The second finds the first one and assigns it, so the references point to the same literal.
English
0
0
0
0
Mgamal2010
Mgamal2010@mogamal2050·
@EclipseJavaIDE True, Java use string pool for this type of string so the two string varaibles refer to same memory location
English
0
0
0
0
DocVillage
DocVillage@docvillage1·
@EclipseJavaIDE true. Java keeps String Objekts declared as literal in an internal String cache using method String.intern(). Thus the objects are identical.
English
0
0
0
0
Blake Eastman
Blake Eastman@bmasterblake·
@EclipseJavaIDE It’s false. You’re checking the reference address, not the contents, since strings are objects. To check string contents you need to use str.eauals(“”);
English
0
0
0
0
Sergej Berišaj
Sergej Berišaj@SergejBerisaj·
@EclipseJavaIDE It's true because java internalizes strings by default. Or does it? DUN DUN DUUUUUUUN
English
0
0
0
0
I-share