The moose likes Beginning Java and the fly likes can we print ascii value of null ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "can we print ascii value of null ?" Watch "can we print ascii value of null ?" New topic

can we print ascii value of null ?

vicky ma
Ranch Hand

Joined: May 13, 2009
Posts: 38
can we print ascii value of null ?
if yes , how ?

asper my knowledge its value is 0
pete stein

Joined: Feb 23, 2007
Posts: 1561
Doesn't exist as they are two unrelated concepts.
Rob Spoor

Joined: Oct 27, 2005
Posts: 19655

In C and C++, NULL, 0 and '\0' are all the same. In Java, 0 and '\0' are the same but null is something completely different; it has no ASCII value because ASCII values are only available for chars. null is not a char.

How To Ask Questions How To Answer Questions
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38048
I presume you mean to ask what the "null character" (as it is called in ASCII) looks like when you print it out. It doesn't look like anything. Try this
And you won't see anything.
I agree. Here's the link: http://aspose.com/file-tools
subject: can we print ascii value of null ?
Similar Threads
ASCII Code of Alt + Print Screen
how to print ASCII value of a number ?
scjp question required
Assigning to char
What happen if we print character '\u0000'