Which data type is used to store text value in Java?

MCQ: Which data type in Java is used to store text?

a) char
b) String
c) int
d) boolean

Answer:

b) String

Explanation:

The 'String' data type in Java is used to store text values, which are enclosed in double quotes.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top