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.
what happens when the code creates a new Wrapper obj assigning a primitive value as follows
It compiles.. but I don't get why.. shouldn't the compiler autobox the primitive value with an implicite call to Integer.valueOf(2)?
I presumed so becouse there is only a method Short.valueOf(short) and calling it with a integer argument yields a compilation issue:
error: no suitable method found for valueOf(int)
so I thought the code yelds to a wrong assignment as
I tried to use javap to decompile but I can't decode the output..
Could you confirm the wrapper class is matter of the oca test?
I found some questions about that in the Deshmukh's oca 1z0-803 book so I would like to dig into the subject..
I have always used the JAva Decompiler (JAD). It isn't maintained anymore, but it still does the job really good. It has already given me useful information many times (e.g. what happens when you use an enhanced-for loop).
Joined: Feb 16, 2013
Jad was the missing brick for the building tests. Surely I'll improve my training..