Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
bit operations in Java
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Oscar Kind, post: 555351"] Remember that a binary string is a number with radix 2. Next, determine what you want to convert: a number (not a String; a String probably needs to be parsed into a number). Then, note that any (integer) number can be represented as a long, and look at the API for java.lang.Long: String binary = Long.toString(number, 2); long number = Long.parseLong(binary, 2); (note: this works slightly different with java.math.BigInteger) Now you only have to catch the esceptions and you're set. Oscar [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
bit operations in Java
Top