Multiple choice technology programming languages

byte, short can be converted to char and vice versa.

  1. True

  2. False

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

In Java, byte and short are signed integer types while char is an unsigned 16-bit Unicode character. They are in different type categories and don't have implicit conversion between them. Explicit casting is required: char c = (char) myByte; or byte b = (byte) myChar; This prevents potential data loss from sign extension.