C# Programming - Strings - Discussion
Discussion Forum : Strings - General Questions (Q.No. 11)
11.
Which of the following statements about a String is correct?
Discussion:
9 comments Page 1 of 1.
Varma_life@yahoo.com said:
1 decade ago
String is a value types, this are implicitly derived from System. ValueType. This class actually overrides the implementation in System. Object, the base class for all objects which is a reference type itself.
Value types are stored in the Stack.
Value types are stored in the Stack.
Subhajit said:
9 years ago
String is always created in string buffer. So no stack, no heap is required for string. String is primitive because primitive data type which are understandable by respected language compiler and string is one of that data type.
Sami said:
1 decade ago
String and object are reference types. While int, float, bool and all other are value types. Value types are stored on stack as well as heap. But strings are always stored on heap.
Gloops said:
1 decade ago
@Varma_Life, please have a look at this :
http://msdn.microsoft.com/en-us/library/s1ax56ch.aspx
http://msdn.microsoft.com/en-US/library/490f96s2.aspx
http://msdn.microsoft.com/en-us/library/s1ax56ch.aspx
http://msdn.microsoft.com/en-US/library/490f96s2.aspx
Yakesh said:
1 decade ago
Ya rajkumar is right, string, object are reference types. All remaining built in data types are value types.
Sudarshan said:
9 years ago
String is reference type.
String s; where s is heap. So string is created on the heap.
String s; where s is heap. So string is created on the heap.
Narasimha said:
9 years ago
String is always reference type so it can stored in heap memory.
Rajkumar said:
1 decade ago
No wrong string is reference type its value store in heap.
Gloops said:
1 decade ago
Really sure a String is not a primitive ?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers