• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

decimal value for "ffff" is 69904

 
Siva kandasamy
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
Please look at the code.
If I uncomment at variable "d", I do get compilation error.
Can you tell me why ?
My understanding is, decimal value for "ffff" is 69904.
Therefor I don't see any difference between variable c and d.
Please forgive my ignorance.

thanks
siva
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
0xFFFF is 65535, not 69904. 69904 is thus somewhat larger than the largest possible char value -- hence the compile error.
 
Ray Stojonic
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
0xffff == 65535 == Character.MAX_VALUE
Decimal value of a hex number can be found by adding the product of each hex digit multiplied by 16^(position), as such:

hth
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic