This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is bit depth of a boolean ?

 
tue march
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

what is the bit depth of a boolean.

Rds,
Good guy
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'bit depth'? do you mean size in bits?

a boolean has only one bit.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No,
Size of boolean depends on JVM.
[ November 24, 2008: Message edited by: ankur rathi ]
 
tue march
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
rathi
 
paraakaram verma
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ankur ...

do you know how bit depth of boolean is dependent on
JVM

Thanks
Paraakaram
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A boolean represents one bit of information. How it is stored (whether one boolean per memory word, or packed with other boolean values in a single word, or in some radically different way that takes up 1000 bytes per boolean) is up to the JVM, as long as the other JLS provisions for primitive types are met.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic