2:44 am - Tuesday April 23, 2019

Byte Example Program for static Byte valueOf(String s,int radix)

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 valueOf(String s,int
 *                   radix)
 */

public class ByteValueOf

{
	
	public static void main(String[] args) {
	
		String str1 = "-1111"; // creating a String
		
		Byte byt; // creating a Byte
		
		byt = Byte.valueOf(str1, 2);
		
		String str = "Byte value of string " + str1 + " using radix 2 is "
				+ byt;
		
		System.out.println(str);
		
	}
	
}

OUTPUT:

Byte value of string -1111 using radix 2 is -15

Filed in: Z-A All Java Codes

Comments are closed.