Multiple choice technology web technology

The Range of values for Primitive type 'char' in java is

  1. -2^15 to 2^15-1

  2. -2^7 to 2^7-1

  3. -2^31 to 2^31-1

  4. 0 to 2^16-1

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

Java's char primitive type is a 16-bit unsigned integer representing UTF-16 code units, ranging from 0 (null character) to 65535 (2^16-1). Unlike other integral types (byte, short, int), char is unsigned and cannot represent negative values. Option A describes short, B describes byte, and C describes int.