2:21 am - Tuesday April 23, 2019

Byte Example Program for decode(String nm)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
 * @author :CandidJava.com
 * @descriptions : This program explain the function and use of decoding to
 *               string to byte
 */
class ByteValueDecode {
	
	public static void main(String arg[]) throws Exception {
	
		String nm = "0x12";// string value should be decimal, hexadecimal, and
							// octal numbers
		byte b = Byte.decode(nm);// to decode string to byte value
		System.out.println("Decoded Byte value=" + b);
	}
}

Output:
D:CandidJavalangByte>javac ByteValueDecode.java
D:CandidJavalangByte >java ByteValueDecode
Decoded Byte value =18

BACK

Filed in: Z-A All Java Codes

Comments are closed.