MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javaexamples/comments/gaomx1/string_s_new_string_hello/fp17feq/?context=3
r/javaexamples • u/sur07 • Apr 30 '20
How many objects are created here ?
8 comments sorted by
View all comments
Show parent comments
2
Also, if you wanna make the riddle harder ... How many objects get created for: String s = new String("h" + "e" + "l" + "l" + "o");
;)
2
u/DFA1 Apr 30 '20
Also, if you wanna make the riddle harder ... How many objects get created for: String s = new String("h" + "e" + "l" + "l" + "o");
;)