This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes question about wrappers.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "question about wrappers.." Watch "question about wrappers.." New topic

question about wrappers..

Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561

the result (uncommenting all the lines) is:
3, 9, 11, 17
Can anyone explain to me why 17 is printed?
I do understand the lines that are commented, but the last one I don't
[ June 15, 2003: Message edited by: Andres Gonzalez ]

I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
so u didn't understand that "why the last output number is 17?"
well, how did u understand the other output numbers? they r in some "radix" right? first is binary, second is octal, third is decimal and forth is?? - Hexadecimal (base 16).
base for,
binary is -2
octal is -8
decimal is - 10
hexadecimal is - 16
so the 11 in,
binary = 2*1 + 1 = 3
octal = 64*0 + 8*1 + 1 = 9
decimal = 10*1 + 1 = 11
hexadecimal = 16*1 +1 = 17
thats how we get 17.
did i address ur problem?
its just different radix systems...
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: question about wrappers..
It's not a secret anymore!