Languages

How to convert binary String to int in java?

14 points
Asked by:
Brett4
285

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
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