The questions are about the study guide for OCP Oracle Certified Professional Java SE 11 by Jeanne Boyarsky and Scott Selikoff.
1) Default value for long
On p 53, the table shows that the default value for long is 0. However, the answer to the review question 8 on page 495 shows that the default value is 0L. When I tested with printing uninitialized class variables of type long and float, they defaulted to 0 and 0.0 respectively. Why is 0L the right answer to question 8 of Ch II review test then?
2) Changing numeric base
On p 68, first paragraph ends with saying that the latter four indicate a change of numeric base. However the first two in the list are decimal and octal - isn't octal also a change of numeric base compared to decimal? Shouldn't it then be 'the latter five'?
The question about 0/0L has come up here several times. One of the authors said it simply means that the default values are zero throughout rather that specifying the format of that 0 (64 bits rather than 32 bits). Look at this discussion..
posted 2 weeks ago
Kairi Kübarsepp wrote:. . . On p 68, first paragraph . . .
Please quote the paragraph so those of us who don't have the book will know what it says.
I'm a beginner. . . .
In that case, a certification exam book is the wrong sort of book for you to buy. It assumes you already know a lot of programming.
Remember to always leap before you look. But always take the time to smell the tiny ads:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps