Two Laptop Bag
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes char default value ? 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 "char default value ?" Watch "char default value ?" New topic

char default value ?

Ranch Hand

Joined: Jul 20, 2000
Posts: 112
Can anyone tell ..what is the default value for char variables ?
1) After the declaration: what is the value of c[50]?
char[] c = new char[100];
a) 50
b) 49
c) '\u0000'
d) '\u0020'
e) " "
f) cannot be determined
g) always null until a value is assigned
Stephanie Grasson
Ranch Hand

Joined: Jun 14, 2000
Posts: 347
The default value for char is '\u0000'.
Hope this helps.
Ranch Hand

Joined: Jul 20, 2000
Posts: 112
Thanks Stephanie.
I agree. Here's the link:
subject: char default value ?
It's not a secret anymore!