What is a Java string?

Java MCQ: What is a Java string?

a) A primitive data type
b) An object that represents a sequence of characters
c) A collection of integers
d) A type of array

Answer:

b) An object that represents a sequence of characters

Explanation:

In Java, a string is an object that represents a sequence of characters. Strings are immutable, meaning once created, their values cannot be changed. They are widely used for text manipulation in Java applications.

Understanding strings is fundamental for handling text and performing various operations like concatenation, comparison, and searching within Java programs.

Reference links:

https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

Leave a Comment

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

Scroll to Top