Byte parseByte(String s, int radix)
parses the string to byte in the radix.
parseByte
has the following syntax.
public static byte parseByte(String s, int radix) throws NumberFormatException
parseByte
has the following parameters.
parseByte
returns the byte value from the string in the radix
In the following code we convert string 10 based on radix 8.
public class Main { public static void main(String[] args) { System.out.println("parse string to byte:"+Byte.parseByte("10", 8)); } }
The output: