Question: State whether each of the following is true or false. If false, explain why. a) When strings are compared with ==, the result is true
State whether each of the following is true or false. If false, explain why.
a) When strings are compared with ==, the result is true if the strings contain the same values.
b) A string can be modified after it’s created.
c) StringBuilder method EnsureCapacity sets the StringBuilder instance’s length to the argument’s value.
d) Method Equals and the equality operator work the same for strings.
e) Method Trim removes all whitespace at the beginning and the end of a string.
f) It’s always better to use strings, rather than StringBuilders, because strings containing the same value will reference the same object.
g) string method ToUpper creates a new string with the first letter capitalized.
Step by Step Solution
3.46 Rating (169 Votes )
There are 3 Steps involved in it
a True b False strings are immutable they cannot be modified after theyre created Str... View full answer
Get step-by-step solutions from verified subject matter experts
