Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
- /*
- * Convert byte primitive to Byte Object example. Program to convert Java
- * byte primitive data type to Byte object.
- */
- public class BytePrimitiveToByteObject {
- public static void main(String args[]){
- //new byte primitive
- byte b = 5;
- //Use Byte(byte b) constructor
- Byte bObj1 = new Byte(b);
- System.out.println("byte converted to Byte: " + bObj1);
- }
- }

Post new comment