<< The New Bloglines Beta: Habit Breaking Changes | Home | An Interesting Experiment: Sapir-Whorf Hypothesis >>

Friday Java Quiz: Null Character In Strings

The usual rules (no Googling, no compiling, etc.)

Q: True or false? In Java, a java.lang.String may contain the null character.

Tags :


Re: Friday Java Quiz: Null Character In Strings

No. Strings in Java are made of char [] behind the scenes, and char are primitive, and can't be null. Maybe there is a non-printable "null" character that can be created with an escape code though.

Re: Friday Java Quiz: Null Character In Strings

Clarification. I should have said the NUL character, the character whose ASCII value is 0.

Re: Friday Java Quiz: Null Character In Strings

Yes, I've dealt with reading files containing the null character.

Re: Friday Java Quiz: Null Character In Strings

Yes, it can!

Re: Friday Java Quiz: Null Character In Strings

Yes!!!

Add a comment Send a TrackBack