Post

@EclipseJavaIDE @java You should stop comparing non-primitives with == to avoid potential bugs. @intellijidea has some nice inspections out of the box to help with that. 😜
English

@EclipseJavaIDE Error: you have written unclear code that is hard to understand or maintain. Please add code comments.
English

@EclipseJavaIDE @java true : substring with zero index returns the same string object
English

@EclipseJavaIDE @java Failure in language design. You should not create a language that allows this ambiguity.
English

@EclipseJavaIDE I'm pretty sure string literals are automatically interned, so I'll go with "true"
English

@EclipseJavaIDE @java It print true based on openjdk source code but it can be true or false based on jre/jvm implementation. Official documentation doesn't note anything about this.
English

@EclipseJavaIDE @java It’s true. I believe Java compiler gives the same reference type for CharSequence and String.
English

@EclipseJavaIDE True. String implements CharSequence. Really you have 2 String instances, and 2 Strings with the same value use the same internal reference.
English


























