Convert Byte to primitive data types


public class Main {

  public static void main(String[] args) {
    Byte bObj = new Byte("10");
    byte b = bObj.byteValue();
    System.out.println(b);
    short s = bObj.shortValue();
    System.out.println(s);
    int i = bObj.intValue();
    System.out.println(i);
    float f = bObj.floatValue();
    System.out.println(f);
    double d = bObj.doubleValue();
    System.out.println(d);
    long l = bObj.longValue();
    System.out.println(l);

  }

}
Home 
  Java Book 
    Runnable examples  

Data Type Byte:
  1. Create Byte from byte value
  2. Convert byte to String using Byte.toString method
  3. Convert byte to String: Using concatenation with an empty String
  4. Convert byte to String: Creating a byte array and passing it to the String constructor
  5. Convert Byte array to Int
  6. Convert byte[] array to String
  7. Content byte[] array to hex string
  8. Convert data to byte array back and forth
  9. Min and Max values of byte
  10. Convert Byte to primitive data types
  11. Convert a byte to it's hexadecimal equivalent
  12. Convert byte Array To Hex String
  13. Shift byte left
  14. Shift byte right
  15. UnSign shift byte right