The valueOf method of Byte class is used for converting a binary String to Byte object.
public class ByteWrapper {
public static void main(String[] args) {
String str = "1010";
Byte objByte = Byte.parseByte(str, 2);
System.out.println(objByte);
}
}
