Microsoft Certified Solutions Developer (MCSD) Certification Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the Microsoft Certified Solutions Developer (MCSD) Exam with comprehensive quizzes, flashcards, and multiple-choice questions. Each query includes hints and clear explanations to help you succeed. Get exam-ready today!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


In the context of the String class, what does immutable mean?

  1. The string can be modified

  2. The string cannot be changed once created

  3. The string can be directly compared

  4. The string can only be converted to numbers

The correct answer is: The string cannot be changed once created

In the context of the String class, the term "immutable" refers to the property that once a string is created, it cannot be changed or modified. This means that any operation that appears to modify a string actually creates a new string instance with the changes applied, rather than altering the original string. For example, if you concatenate two strings, instead of changing the original string, a new string containing the combined value is generated. This design choice enhances performance in certain scenarios, particularly in multithreaded environments, as it reduces the risk of unintended side effects from changes to string values. The other options do not accurately reflect the meaning of immutability. Strings can be compared, but that is not relevant to immutability. Similarly, strings have methods for converting to other types, but the idea of immutability specifically addresses the inability to change the content of the string itself after it has been created.