I read javadoc, but don’t understand the differences, both of them return same result. Also can anyone explain what is ‘zero-extending’ means? Javadoc of chars() method Returns a stream of int zero-extending the char values from this sequence. Any char which maps to a surrogate code point is passed through uninterpreted. The stream binds to this sequence when the terminal
Tag: charsequence
Most efficient way to convert a single char to a CharSequence
What’s the most efficient way to pass a single char to a method expecting a CharSequence? This is what I’ve got: According to the answers given here, this is a sensible way of doing it where the input is a character array. I was wondering if there was a sneaky shortcut I could apply in the single-char case. Answer