HOME      BLOG       FORUMS      CONTACT       ABOUT

Convert an binary String to byte value.

The parseByte method of Byte class is used for converting a binary String to primitive byte value.

public class ByteWrapper {
	public static void main(String[] args) {
		String str = "1010";
		byte b = Byte.parseByte(str, 2);
		System.out.println(b);
	}
}

Share

Tags: , , , ,


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply