Does java define string as null terminated? -
this question has answer here:
- how string terminates in java? 3 answers
as title suggests, it's theoretical question. i'd know if java defines string null terminated.
i'd know if java defines string null terminated.
no. string defined fixed length sequence of char
values. possible char
values (from 0 65535) may used in string. there no "distinguished" value means string ends.
so how track string ending? using length?
yes. string
object has private length
field (in implementations i've examined ...).
if want understand more how java strings implemented, source code various versions available online. google "java.lang.string source".
Comments
Post a Comment