Asked by Thanh Huynh on Jul 15, 2024

verifed

Verified

Which of the following statements about strings is NOT true?

A) When you use the assignment operator to assign a string to a String variable, the computer allocates memory space large enough to store the string.
B) When a string is assigned to a String variable, the string cannot be changed.
C) The class String contains many methods that allow you to change an existing string.
D) A String variable is actually a reference variable.

Assignment Operator

The assignment operator in programming languages is used to assign a value to a variable.

String Variable

A type of variable in programming that is used to store text data, such as words or sentences.

Memory Space

The amount of physical or virtual memory allocated for storing data or program instructions.

  • Recognize the immutable nature of String objects in Java.
verifed

Verified Answer

JW
Jacob WhiteJul 19, 2024
Final Answer :
C
Explanation :
Strings in Java are immutable, meaning once a string is created, it cannot be changed. The class String does contain methods that seem to modify strings, but these methods actually return a new string without altering the original.