bit « Boolean « Java Data Type Q&A

1. What is the bit depth of a boolean in java?

Possible Duplicate:
Java - boolean primitive type - size Possible duplicate:
Someone asked me a question, but I didnt get the ...

2. bit pattern(variable value) for boolean in java?

as we know in java variables are bit holders with a designated type. And for primitives the bits represents a numeric value. For example. a byte with value 6 has a ...

3. how boolean values are treated in java by bit wise operators

consider this example please

int i=11, j=5;
boolean b=true, c=false;
System.out.println(b&c); // --> output=false
System.out.println(i&j); // --> output=1
How bit wise and operator is working on boolean variables ?

5. About boolean bit size

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.

6. what is bit depth of a boolean ?

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.

7. Bit depth of a boolean

8. boolean - how many bits?

Now I need to split the byte. It's almost clear for the 0-5 bits I should use a byte. But for the 1-bit values, what data type should I use? I was thinking of byte and boolean. Any suggestion would be appreciated? (Btw. My 64-bit machine has 8Gb memory, and it's kind of struggling)