This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I trust you know that 38hex means 56dec?
So your compiler goes through the code, and converts all your Unicode escapes to displayed characters. Your \u0038 becomes 8 and your '\u0038' becomes '8'. That is done before you compile anything. I presume you can work out how 8f becomes 8.0 and how '8' becomes 56, now.
The unicode character \u0038 is '8' so in the first case the value 8 is assigned to the variable. In the second case you are assigning the char with a value of \u0038. This is a Hex value which when converted to decimal is 56.
Edit: Even slower
Joined: Jan 17, 2013
Now i got.
Thanks Campbell Ritchie , Tony Docherty