wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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: 6661

Its JVM specific. Not defined

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: memory spacereserved by boolean data type
Similar Threads
question about boolean data type
what is bit depth of a boolean ?
object references and memory space requirements
Size of bool variable
object size