aspose file tools
The moose likes Beginning Java and the fly likes decimal value for Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "decimal value for "ffff" is 69904" Watch "decimal value for "ffff" is 69904" New topic
Author

decimal value for "ffff" is 69904

Siva kandasamy
Ranch Hand

Joined: Dec 31, 2002
Posts: 139
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

Joined: Jul 08, 2003
Posts: 24051
    
  13

0xFFFF is 65535, not 69904. 69904 is thus somewhat larger than the largest possible char value -- hence the compile error.


[Jess in Action][AskingGoodQuestions]
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: decimal value for "ffff" is 69904
 
Similar Threads
Mock Exam Fundamentals 1 - questions 6,7
Numerice value for letter 'a'
problem with compiler's no problem:-(
Hexadecimal Numbers
chars