Is the object being instantiated mutable or immutable 1 Dim
Is the object being instantiated mutable or immutable?
1) Dim stuff() As String = \"Stuff\"
2) Dim myCharArray() As Char = {\"A\", \"B\", \"C\", \"D\", \"E\", \"F\"}
Solution
In .Net the String object is an immutable object, which means that it’s basically constant and can’t be changed. You can’t change a string, you can only create new strings. The various methods that the String class have never directly change the string they operate on, instead they return a new string.
example:
Question 2:
Arrays are immutable. An array stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of same type of data.All arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element.
