File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes default value for char? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "default value for char?" Watch "default value for char?" New topic

default value for char?

Venkata Raaman
Ranch Hand

Joined: Mar 26, 2010
Posts: 46

Hi I am trying to access default values in a class by creating instance and static as well.
default value for bool is false, int is 0, that way But when i use char it prints nothing just a whitespace.
here is the code

Is it supposed to be that way??\u0000 is the default value?what will it shows on screen?
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

\u0000 is not a whitespace. Check what it is in this Unicode Table.

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: default value for char?
jQuery in Action, 3rd edition