Multiple choice technology databases

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 a 64-bit signed integer, which uses 8 bytes of memory. This is specified in the Java Language Specification and is consistent across all JVM implementations, making it platform-independent.