How do I initialize an int from a string of binary digits?

To go from something like "0101010101" to the int equivalent, use the Integer.parseInt(binaryString, 2) method. If you prefer to go to an Integer, instead of an int, use Integer.valueOf(binaryString, 2) instead. The 2 represents the radix, or base of the number.

Advertiser Disclosure:
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.