my dog learned polymorphism
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes about char declaration 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 "about char declaration" Watch "about char declaration" New topic

about char declaration

wei liu
Ranch Hand

Joined: Dec 06, 2001
Posts: 56
what is the range of char data type?
0 to 2^16-1
are these two declaration correct? why?
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
these are correct as char is UNICODE char in java having 2 bytes (16bits that is 2^16 -1 as max number)
I agree. Here's the link:
subject: about char declaration
It's not a secret anymore!