• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about char declaration

 
wei liu
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the range of char data type?
0 to 2^16-1
'\u0000'to'\uFFFF'
are these two declaration correct? why?
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
these are correct as char is UNICODE char in java having 2 bytes (16bits that is 2^16 -1 as max number)
regards
maulin.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic