You can look at this documentation of autoboxing and unpacking.
Autoboxing and unboxing allows developers to write cleaner code, making it easier to read. The following table lists the primitive types and their corresponding wrapper classes that are used by the Java compiler for autoboxing and unpacking:

Thus, based on this table, you cannot directly use autobox, nor can you drop into Double from byte. And also you cannot unpack twice from byte.
But you can apply the primitive to the primitive type, and then automatically translate it into an object of the Wrapper class. And you can unzip the Wrapper class object to its primitive type, and then pass it to other primitive types.
byte x = 5; double temp = x; Double y = temp; // Can be written as byte x1 = 5; Double y1 = (double) x1; // ================ Byte n = 7; byte byteVal = n; double doubleVal = byteVal; Double m = doubleVal; // Can be written as Byte n1 = 7; Double m1 = (double) (byte) n1; // ================= // But I still wonder how below code is working double c = n;
source share