What is the size of the char data type in Java?
-
A
16 bits
Correct answer
-
B
32 bits
-
C
4 bits
-
D
8 bits
Correct answer
A. 16 bits
19 views
Explanation
A Java char is 16 bits, because it stores a UTF-16 code unit. That lets it hold far more characters than an 8-bit C char.
Reference
Asked in: NTS, PPSC, OCA Java
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ