Byte parseByte(String s)
parses the string argument as a byte.
parseByte
has the following syntax.
public static byte parseByte(String s) throws NumberFormatException
parseByte
has the following parameters.
parseByte
returns
the byte value represented by the string
In the following code shows how to use Byte.parseByte(String s) method.
The following code uses Byte.parseByte
to convert string value to byte value.
public class Main { public static void main(String[] args) { System.out.println("parse string to byte:"+Byte.parseByte("10")); } }
The output: