Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About boolean bit size

 
Shakthi Anuradha
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the bollean bit size. Someone says it is one bit.
In some fo books says it depend on the JVM.Tell me what is the ture.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

Sorry to tell you this, but it's entirely dependent on the JVM implementation.
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally, you should not care about the actual size, in memory, of a boolean. It has two usable values, true and false, but may take up more memory than is strictly required for that, depending on performance and alignment issues on the platform. But, as you can't do bit-wise operations on it anyway, you don't care.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic