Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!

# Question on Integer.toBinaryString (maybe)

ravel chen
Greenhorn
Posts: 3
Here is the code,which I wrote to figure out sign(and unsign) concept.

After compiling
I got
11110111111100011101011111001011
11111011111110001110101111100101
11111101111111000111010111110010
11111110111111100011101011111001
11111111011111110001110101111100
11111111101111111000111010111110
11111111110111111100011101011111
11111111111011111110001110101111
11111111111101111111000111010111
11111111111110111111100011101011
11111111111111011111110001110101
11111111111111101111111000111010
11111111111111110111111100011101
11111111111111111011111110001110
11111111111111111101111111000111
11111111111111111110111111100011
11111111111111111111011111110001
11111111111111111111101111111000
11111111111111111111110111111100
11111111111111111111111011111110
11111111111111111111111101111111
11111111111111111111111110111111
11111111111111111111111111011111
11111111111111111111111111101111
11111111111111111111111111110111
11111111111111111111111111111011
11111111111111111111111111111101
11111111111111111111111111111110
11111111111111111111111111111111
11111111111111111111111111111111
11111111111111111111111111111111
11111111111111111111111111111111
11110111111100011101011111001011

My question is
Is there any way that I can see the 33 results directly
in integer form by adding some words?
Simply speaking,how do I translate some strings like
(11111011111110001110101111100101) to integer?
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ March 15, 2004: Message edited by: Dirk Schreckmann ]

Jean-Francois Briere
Ranch Hand
Posts: 101

Vicken Karaoghlanian
Ranch Hand
Posts: 522
You can try what Jean suggested or you can try this

If you need to obtain other bases, consider changing 2 to 8 for Octal or 16 for Hex ...etc.
[ March 15, 2004: Message edited by: Vicken Karaoghlanian ]

Dirk Schreckmann
Sheriff
Posts: 7023
Welcome to JavaRanch, ravel chen!
I've very happy that some fellow ranchers have already helped to point you in the right direction for solving your problem. I'm posting just to suggest a simple tip to help improve communications in these forums.
When posting code, please be sure to surround the code with the [code] and [/code] UBB Tags. This will help to preserve the formatting of the code, thus making it easier to read and understand.