C# Programming - Strings - Discussion

Discussion :: Strings - General Questions (Q.No.12)

12. 

Which of the following statement is correct about a String in C#.NET?

[A]. A String is mutable because it can be modified once it has been created.
[B]. Methods of the String class can be used to modify the string.
[C]. A number CANNOT be represented in the form of a String.
[D]. A String has a zero-based index.
[E]. The System.Array class is used to represent a string.

Answer: Option D

Explanation:

No answer description available for this question.

Rajkumar said: (Dec 27, 2011)  
String is refrence type so it is store in heep and it execution is slower then value type which is store in stack.

Vishu said: (Mar 2, 2012)  
Why not [B]? we can modify string with the help of substring, copy.

Sami said: (Jan 5, 2014)  
I think substring, copy, compare, equal etc are not used to modify the string. These methods are used to act on data and perform different task but they do not change the content of original string.

Manish said: (Jul 9, 2015)  
Answer is correct it is D.

Mutable: Mutable means whose state can be changed after it is created.

Immutable: Immutable means whose state cannot be changed once it is created.

String objects are 'immutable' it means we cannot modify the characters contained in string also operation on string produce a modified version rather than modifying characters of string.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.