Get your CodeRanch badge!*
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
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: 6657

Its JVM specific. Not defined

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Consider Paul's rocket mass heater.
subject: memory spacereserved by boolean data type
Similar Threads
object size
Size of bool variable
question about boolean data type
what is bit depth of a boolean ?
object references and memory space requirements