This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Integer and Character Representation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Integer and Character Representation" Watch "Integer and Character Representation" New topic
Author

Integer and Character Representation

Uma Kanth
Greenhorn

Joined: Sep 16, 2002
Posts: 20
Can some body please explain me the following two terms ?
1)signed two's-complement integers
2)16-bit unsigned integers representing Unicode characters
Thanx in advance
Leandro Oliveira
Ranch Hand

Joined: Nov 07, 2002
Posts: 298
signed:
byte ---> -128 to +127
unsigned
char ---> 0 to +65535
-------------------------------------------------
the two's complement:
(working with bytes)
decimal binary
4 ---- 00000100
-4 ---- 11111100
how did I find that -4 was 11111100??
1)invert all bits:
00000100 becomes 11111011
2)add another bit to the end
11111011 + 1 --> 11111100

ok???
Uma Kanth
Greenhorn

Joined: Sep 16, 2002
Posts: 20
Thanx alot
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Integer and Character Representation
 
Similar Threads
bit shiftting pblm
a question about method local variables
few scenarios in JAVA where instinct doesn'n play right
array
JSlider Float Values