Java Byte parseByte() method21 Mar 2025 | 2 min read The parseByte() method of Java Byte class parses the string argument as a signed decimal. All the characters in the String should be decimal digits, except the first character which can be an ASCII minus or plus sign. The second parameter parses the specified string argument as a signed byte in the specified radix. Syntax:Parameters:The parameters 's' and 'radix' represent the string to be parsed and the radix to be used while parsing s. ThrowsThe parseByte() method throws: NumberFormatException- if the string does not contain a parsable byte. Return ValueThis method returns the byte value represented by the argument in decimal. Example 1Output: -8 Example 2Output: Exception in thread "main" java.lang.NumberFormatException: radix 0 less than Character.MIN_RADIX at java.lang.Integer.parseInt(Integer.java:546) at java.lang.Byte.parseByte(Byte.java:149) at com.TpointTech.JavaByteParseByteExample2.main(JavaByteParseByteExample2.java:8) Example 3Output: 113 Example 4Output: 36 Exception in thread "main" java.lang.NumberFormatException: Value out of range. Value:"null" Radix:36 at java.lang.Byte.parseByte(Byte.java:151) at com.TpointTech.JavaByteParseByteExample4.main(JavaByteParseByteExample4.java:8) Next TopicJava Byte |
We request you to subscribe our newsletter for upcoming updates.

We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India