3:53 pm - Tuesday March 25, 8932

Integer Example Program for static Byte 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
 *@description:java Byte Example program for static Byte decode(String nm)
 */

public class ByteDecode

{
	public static void main(String[] args) {

		Byte b1, b2, b3; // creating 3 Byte objects

		b1 = Byte.decode("52"); // decimal value are decoded and assigned to
								// Byte objects b1

		b2 = Byte.decode("0x6c"); // hexadecimal value are decoded and assigned
									// to Byte objects b2

		b3 = Byte.decode("017"); // octal value is decoded and assigned to Byte
									// object b3

		System.out.println("Byte value of decimal 52 is " + b1);
		System.out.println("Byte value of hexadecimal 0x6c is " + b2); // printing
																		// decoded
																		// b1,
																		// b2,
																		// b3,
																		// b4
																		// values
		System.out.println("Byte value of octal 017 is " + b3);

	}

}

OUTPUT:

Byte value of decimal 52 is 52
Byte value of hexadecimal 0x6c is 108
Byte value of octal 017 is 15

Filed in: Z-A All Java Codes

Comments are closed.