• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Sybex CSG 11 page 55 (Kindle version)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the "TABLE 2.3 Default initialization values by type" it is mentioned that all numeric types: byte, short, int, long have default value 0. But the default value for long type is 0L and not 0. And for float and double is 0.0f and 0.0d, not just 0.0. (https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html)



 
author
Posts: 4356
45
jQuery Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
0 is 0.  0f and 0L is just the style of writing the literal for the compiler so it knows how to interpret it.  I promise the exam will never ask you the difference between 0L and 0!
 
reply
    Bookmark Topic Watch Topic
  • New Topic