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. 2

  3. 4

  4. 8

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

Java primitive long is always 8 bytes (64 bits) regardless of the compiler or platform. Java specifications define exact sizes for primitives to ensure cross-platform consistency.