Java source code examples

Java source code samples. Java code examples.

Convert an octal String to byte value.

0 votes Vote!!

The parseByte method of Byte class is used for converting a octal String to primitive byte value.

public class ByteWrapper {
	public static void main(String[] args) {
		String str = "7";
		byte b = Byte.parseByte(str, 8);
		System.out.println(b);
	}
}
  • Share/Bookmark

Tags: java.lang

Discuss This Code