Use Integer.parseInt
(see javadoc), that converts your String
to int
using base two:
int decimalValue = Integer.parseInt(c, 2);
More Related Contents:
- Why don’t Java’s +=, -=, *=, /= compound assignment operators require casting?
- How do I remove objects from an array in Java?
- Why should I use the keyword “final” on a method parameter in Java?
- What is the Java equivalent for LINQ? [closed]
- The specified child already has a parent. You must call removeView() on the child’s parent first (Android)
- What causes a java.lang.StackOverflowError
- System.out to a file in java
- Reading a JSP variable from JavaScript
- Java lib or app to convert CSV to XML file? [closed]
- javascript error: Failed to execute ‘elementsFromPoint’ on ‘Document’: The provided double value is non-finite
- Cleanest way to toggle a boolean variable in Java?
- Is there a way in Java to convert an integer to its ordinal name?
- Java EE 6 vs. Spring 3 stack [closed]
- How to combine two Jar files
- Suppressing the “Picked up _JAVA_OPTIONS” message [closed]
- running 3 threads in sequence java
- Java: Updating text in the command-line without a new line
- How to write NDEF records to NFC tag?
- How to remove single character from a String by index
- How to center cells in JTable
- Component for filtering a list
- How to deploy a Java Web Application (.war) on tomcat?
- User authentication in SOAP Webservices
- Java Pi calculator getting stuck
- Java – Reading XML file
- Pause the timer and then continue it [duplicate]
- Java Swing – running on EDT
- When does Java’s garbage collection free a memory allocation?
- Objects eligible for garbage collection
- How to create jar file with package structure?