American Express Interview Question

Name the primitive types and their bit lengths.

Interview Answer

Anonymous

Apr 1, 2016

Java primitives: byte 8 bit 2's complement short 16 bit 2's complement int 32 bit 2's complement long 64 bit 2's complement float 32 bit floating point number double 64 bit floating point number char 16 bit unicode character boolean (depends on JVM for length) T/F value (I forgot byte and short but remember various details about bit lengths and floating point exponent/mantissa bit lengths which impressed them enough to overlook it)