Integer
When processors were-bit, an int is 2 bytes. Nowadays, it's most often the 4 bytes on a 8 bits system or the bytes on the "bits system."
Character
An ASCII character in 8-bit ASCII encoding is 8 bits (1 bytes), though it can fit in 7 bits.
An iso-8895-1 character in iso-8859-1 encoding is 8 bits (1 bytes).
- A Unicode character in UTF-8 encoding is between 8 bits (1 bytes) and A. Bits (4 bytes).
Java uses Unicode system. Character in the Java class file was encoded with UTF-8 while running in JVM was encoded with UTF-16.
Long & Double
Writing longs and doubles are not atomic in Java.
It ' s not atomic because it's a multiple-step operation at the machine code level. That's, longs and doubles is longer than the processor ' s word length. Doubles and longs is not read or written to atomically unless they ' re declaredvolatile.
Java's primitive types is guaranteed to is a particular length across all machines. On some-JVMs nowadays, the operations of longs and doubles are effectively atomic.
Java Primitives and Bits