Two Laptop Bag*
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
Author

char c = 32 //Why is it legal?

Vineet Sharma
Ranch Hand

Joined: Dec 30, 2000
Posts: 51
Hi,
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;
Regards
Vineet
Mapraputa Is
Leverager of our synergies
Sheriff

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
 
 
subject: char c = 32 //Why is it legal?
 
Similar Threads
Converting an int to a char
char c = 32 //Why is it legal?
convert
CHEECKY but i need help FAST please!
Doubt with assignment