• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

char range

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey java ppl
i have a slight problem .
Is the data range of char is 0-65536 or is it 0-65535
I ask this because every where it is written that range is 0-65536 but when i write this line
char c=65536 ;
it gives compile time error.
Please tell me what is going on
Regards denish
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi denish,
0 to 2^16-1
0 to 65535
0 to 1111 1111 1111 1111
'\u0000' to '\uFFFF'
All of above are equivalent, since char is unsigned 2 byte integer.
 
reply
    Bookmark Topic Watch Topic
  • New Topic