Multiple choice technology programming languages

What is the number of bytes used by Java primitive long.

  1. The number of bytes is compiler dependent.

  2. 4

  3. 8

  4. 64

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In Java, the primitive 'long' type always occupies 8 bytes (64 bits) regardless of the platform or compiler. This is part of Java's design to ensure consistent behavior across different architectures - unlike C/C++ where primitive sizes can be compiler-dependent.