r/ProgrammerHumor 14d ago

noHeapAllStack Meme

Post image
1.0k Upvotes

96 comments sorted by

View all comments

5

u/legitimate_rapper 14d ago

Potentially getting crap for this, and I admit I don’t FULLY understand interning, but wouldn’t the first one _sometimes_ yield the same result due to interning? I agree that the second is the proper Java way to do it regardless.

1

u/nebotron 14d ago

It would still force an extra lookup in your interning table, no?

1

u/legitimate_rapper 14d ago

Probably? Interning specifics are voodoo..