0

What's the difference between subsequence(first, last) and substring (first, last) .

I didn't find any difference when I compiled it

26th Mar 2021, 12:14 PM
kreddyt
kreddyt - avatar
4 Answers
+ 3
CharSequence is an interface and String is a class. String, StringBuilder, StringBuffer, CharBuffer and Segment implements this interface. https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/lang/CharSequence.html You can also read here about the difference: https://www.baeldung.com/java-char-sequence-string
26th Mar 2021, 3:23 PM
Denise Roßberg
Denise Roßberg - avatar
26th Mar 2021, 12:22 PM
Avinesh
Avinesh - avatar
+ 2
Read the 1st answer on that link. It is explained pretty well.
26th Mar 2021, 12:38 PM
Avinesh
Avinesh - avatar
0
Can u make it clear I didn't get it :( Avinesh
26th Mar 2021, 12:34 PM
kreddyt
kreddyt - avatar