Talk:Null character

From Wikipedia, the free encyclopedia

Dcoetzee, Java does have a null terminator. If you don't believe me, click here. [[User:Supadawg|supadawg - talk - contribs]] 15:02, 14 Aug 2004 (UTC)

Java has a null terminator character, since it uses the ASCII character set, but it is not, as your modification explicitly said, used to terminate strings. Java strings are objects and can contain embedded nulls. Deco 23:01, 14 Aug 2004 (UTC)

The page is called "Null character". We've just established that Java has a null character. Therefore, it should be included, with a change of wording in the introduction.
P.S. I won't change the page until we agree on something, to avoid an edit war. [[User:Supadawg|supadawg - talk - contribs]] 23:08, 14 Aug 2004 (UTC)

Java does not use the ASCII character set, it uses Unicode. The null character exists but it is not called "null terminator character" because it is not used to mark the end of a string.

You're right, sorry for my errors. In any case the null character has no special meaning in Java. Deco 06:39, 20 August 2005 (UTC)

I would really like to see a source for this:

"Null-terminated strings can also have efficiency benefits, since operations that traverse a string don't need to keep track of how many characters have been seen, and operations which modify the string's length do not need to update the stored length. Cache performance can also be better."

So have added citation needed. For one, on most architectures both a "subtract and jump if not zero" is identical to a "compare and jump if not zero". Yet by having the length first loops can be unrolled for far greater speed - something that is very difficult to do with a null terminator. For example, many languages that have known lengths are able to use sse2 and move 16 bytes at a time from a string - the same procedure to move a C style string performs atrociously in comparison. Themania (talk) 14:17, 28 January 2008 (UTC)