Byte(String s)
creates a Byte object to represent the byte value indicated by the String parameter.
The string is converted to a byte value in the same way as parseByte method for radix 10.
Byte
has the following syntax.
public Byte(String s) throws NumberFormatException
Byte
has the following parameters.
Byte
throws.
In the following code shows how to use Byte.Byte(String s) constructor.
public class Main { public static void main(String[] args) { Byte byteObject = new Byte("100"); System.out.println(byteObject); } }
The output: