Core Java Tutorials | Primitive To Object Conversion | Java Wrapper Classes

This Core Java Tutorials  “Primitive To Object data conversion” post explains clearly what is boxing in java and how to covert primitive byte to Byte object using pre-defined method of Byte class.


 

Boxing :

  • Converting primitive byte to object Byte.
  • Byte data conversions can be performed using java.lang.Byte class.

 

Following method available in Byte class used to perform Boxing :

 

  • The following example describes how to perform Boxing.
  • In the above example, we use static method of Byte class to convert primitive byte to Object Byte type.

 

Share this