6
Contributors
5
Replies
32
Views
3 Years
Discussion Span
Last Post by stultuske
Featured Replies
  • 1

    [Integer.toBinaryString(int)](http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#toBinaryString(int)) in case you don't have to implement the algorithm yourself. Also note that if you write e.g. `int x = 5;` the 5 is *actually* stored in binary. `System.out.println(x);` prints 5 because the binary value in x is converted to base 10 for display. Read More

1

Integer.toBinaryString(int) in case you don't have to implement the algorithm yourself.

Also note that if you write e.g. int x = 5; the 5 is actually stored in binary.
System.out.println(x); prints 5 because the binary value in x is converted to base 10 for display.

Edited by mvmalderen

0

don't like to roseindia, it's the worst excuse for a programming help website out there.
Or if you link to them, link to them as an example how not to do something.

mvmalderen has the correct answer, unless of course you are receiving a different binary representation from the one that Java is expecting (little endian vs. big endian, etc.).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.