It's possible it's done in C and other languages for completeness. It's possible for subSequence to return an empty CharSequence (start = end). If you implemented subSequence to include the index...
Type: Posts; User: helloworld922
It's possible it's done in C and other languages for completeness. It's possible for subSequence to return an empty CharSequence (start = end). If you implemented subSequence to include the index...
Sounds reasonable to me, so most likely Java uses the other mechanism I described where string length is stored somewhere (which makes sense since there's a constant length field :P). However, as...
Oh, I see. The variable name s is used in so many different places it's confusing to keep them straight :( What I was referring to was the String field s inside the CharSequenceDemo class.
The IDE...
1. Strings are immutable (i.e. a String object can't be changed/modified). The only way to modify a String is to change what String object a String variable refers to.
2. If you want to add extra...