Languages

How to convert binary String to int in java?

14 points
Asked by:
Brett4
405

For example when I have:

//                      binary str // int
String binaryString1 = "00000101"; // -> 5
String binaryString2 = "00001000"; // -> 8
String binaryString3 = "11111111"; // -> 255

What is the best way I can convert those numbers to integer in java?

0 answers
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join