Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

OCP Java SE 11 study guide question

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
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'?

Thanks for any explanations!
I'm a beginner.

Kairi
 
Marshal
Posts: 75700
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

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..
 
Campbell Ritchie
Marshal
Posts: 75700
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Don't touch me. And dont' touch this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic