This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "char default value ?" Watch "char default value ?" New topic
Author

char default value ?

Aru
Ranch Hand

Joined: Jul 20, 2000
Posts: 112
Hi,
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
Thx
Stephanie Grasson
Ranch Hand

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

Joined: Jul 20, 2000
Posts: 112
Thanks Stephanie.
 
Don't get me started about those stupid light bulbs.
 
subject: char default value ?
 
Similar Threads
What is the correct answer?
assignment operator
clear the doubt please
char array
'\u000' != " " true or false