This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes memory spacereserved by  boolean data type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "memory spacereserved by  boolean data type" Watch "memory spacereserved by  boolean data type" New topic

memory spacereserved by boolean data type

Jalees Ahmed

Joined: Jul 10, 2008
Posts: 3
Could you please tell me the size reserved by boolean variable in the memory.
Like int take 4 bytes,char take 2 bytes,etc.
Thanks in advance....
Eric Daly
Ranch Hand

Joined: Jul 11, 2006
Posts: 143
Taken from Sun's Java Tutorial:

boolean: The boolean data type has only two possible values: true and false. Use this data type for simple flags that track true/false conditions. This data type represents one bit of information, but its "size" isn't something that's precisely defined.

Studying for SCJP 6
Deepak Bala

Joined: Feb 24, 2006
Posts: 6662

Its JVM specific. Not defined

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
subject: memory spacereserved by boolean data type