File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Mock Exam Errata and the fly likes char c = 32 //Why is it legal? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "char c = 32 //Why is it legal?" Watch "char c = 32 //Why is it legal?" New topic

char c = 32 //Why is it legal?

Vineet Sharma
Ranch Hand

Joined: Dec 30, 2000
Posts: 51
char is "narrower" than int. Then how come the following does not give any error. (Note that no casting has been done.)
char c = 32;
Mapraputa Is
Leverager of our synergies

Joined: Aug 26, 2000
Posts: 10065
Moving this to Programmer Certification Study forum...

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
I agree. Here's the link:
subject: char c = 32 //Why is it legal?
It's not a secret anymore!