• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Sybex CSG 11 page 55 (Kindle version)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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: 4226
33
jQuery Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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!
 
We're all out of roofs. But we still have tiny ads:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic