21
Reply

Is 'string' a value type or Reference type?

Kasam Shaikh

Kasam Shaikh

Sep 20, 2016
949
1

    It is a reference type and more......explanation ........... .NET provides String Intern Pool to help in optimizing the usage of strings. String Intern Pool is a special table allocated on Large Object Heap which maintains references of all strings that are created on a program. CLR keeps track of those strings that are created in memory and uses it when it needs to create the same string again. This ensures that new memory is not used whenever the content of the string is not different.

    Sujeet Singh
    May 29, 2017
    1

    String is ref type.

    Sridhar Sharma
    March 02, 2017
    1

    string is reference type and default is sealed class.

    Naveen Bisht
    February 16, 2017
    1

    Reference type because its does not have default allocation size

    Ayappan Alagesan
    February 10, 2017
    1

    String is a reference type and behaves like value type.

    Kasam Shaikh
    September 20, 2016
    1

    string is reference type,all primitive data types except general data type(string &object ) are value types.class, interface and delegates are reference type,in which the memory will store in heap memory.structures and enums are value type in which memory will store in stack memory

    Kiran Kumar
    October 24, 2017
    0

    Reference type

    Mukesh Kumar
    September 30, 2017
    0

    Reference type

    Mukesh Kumar
    September 30, 2017
    0

    Reference type

    Mukesh Kumar
    September 30, 2017
    0

    Reference type

    Mukesh Kumar
    September 30, 2017
    0

    Reference type

    Mukesh Kumar
    September 30, 2017
    0

    Reference type

    Mukesh Kumar
    September 30, 2017
    0

    Reference type

    Mukesh Kumar
    September 30, 2017
    0

    Reference type

    Mukesh Kumar
    September 30, 2017
    0

    Reference

    Mukesh Kumar
    September 10, 2017
    0

    Reference

    Mukesh Kumar
    September 10, 2017
    0

    Reference

    Mukesh Kumar
    September 04, 2017
    0

    Reference

    Mukesh Kumar
    August 29, 2017
    0

    string is reference type and it value stored on heap. String is a reference type instead of a value type because it was of crucial importance for Microsoft to ensure that strings could be stored in the most efficient way in non-generic collections, such as System.Collection.ArrayList.

    sushil kumar
    July 20, 2017
    0

    It is a ref type

    Sripathi Rao
    July 07, 2017
    0

    string is a reference type. In the following code: string message = "Hello"; The actual content "Hello" is stored on the heap while the message variable is stored on the stack. Message contains a reference to that text.

    Kyle Cheung
    March 14, 2017
    0