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.
The answer is 3 (only "c" is printed), but my question is that since NullPointerException is a RuntimeException, it doesn't have to be caught. So shouldn't the output be "a", "c" and "d"? [ September 01, 2007: Message edited by: Sachin Kapoor ]
If double can hold hexadecimal values, shouldn't the Double (wrapper) class's valueOf method be overloaded to take base/radix as argument?
There is no concept of storing hexidecimal numbers, even for integers. Integer variables stores integer numbers -- the compiler just allows you to define the integer in hexidecimal format.
For doubles, the compiler allows you to implicitedly cast from int to double. So in this case, you are casting an int literal (defined in hexidecimal format) to a double, and storing it in a double variable.