First, if you were looking for a null character you would probably want to do (char)0
because ""
is an empty string (no character).
Second, if Java uses a null character (they don’t have to IIRC) then they hide it.
EDIT: Struck my third point because I’m not sure about it anymore.
SECOND EDIT: I looked it up, Java strings are not null terminated. They rely on the length field.
5
solved “Hello”.indexOf(“”) returns 0 [duplicate]