?
Which data type is used to store a single character in Java?
Answer & Solution
Correct Answer:
Option
A
The correct answer is Option A: char.
In Java, the char data type is used to store a single character. It can hold any single Unicode character, including letters, digits, and special symbols.
Using char allows you to store individual characters like 'A', '7', '$', etc., whereas String (Option B) is used to store a sequence of characters (a string of characters).
Options C and D are not valid data types in Java.
In Java, the char data type is used to store a single character. It can hold any single Unicode character, including letters, digits, and special symbols.
Using char allows you to store individual characters like 'A', '7', '$', etc., whereas String (Option B) is used to store a sequence of characters (a string of characters).
Options C and D are not valid data types in Java.
Join the Discussion
Login to post a comment or share your explanation.
Login