In RHE chapter 1, Literals, only integral literal hexadecimal is touched. It is said 28 in Hex is 0x1c.
In Barry Booneexam 1,
Question 6: Which assignments are legal?
Select all valid answers.
a. long test = 012;
b. float f = -412;
c. int other = (int)true;
d. double d = 0x12345678;
e. short s = 10;
Answer are abde.
My opinion: according to answer d,because double is 64 bits, so hexadecimal is 8 numbers not including "0x". If things work like this, the integral literal default is int type, so the hexadecimal for it should be in 4 numbers? But in RHE it is said in 2 numbers. I know RHE is barely wrong, but I am confused here, can anybody clear me out? What is the rule for hexadecimal? Can double and float be expressed in hexadecimal?
Any of your opinion is highly appreciated!!