permaculture playing cards
The moose likes Beginning Java and the fly likes About boolean bit size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "About boolean bit size" Watch "About boolean bit size" New topic

About boolean bit size

Shakthi Anuradha

Joined: Nov 16, 2004
Posts: 5
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

Joined: Jul 08, 2003
Posts: 24199


Welcome to JavaRanch!

Sorry to tell you this, but it's entirely dependent on the JVM implementation.

[Jess in Action][AskingGoodQuestions]
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
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.

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
I agree. Here's the link:
subject: About boolean bit size
jQuery in Action, 3rd edition