Question
What do you mean by string objects are immutable?

Answers

String objects are immutable means, they cannot be changed after they have been created. All of the String methods and C# operators that appear to modify a string actually return the results in a new string object. In the following example, when the contents of s1 and s2 are concatenated to form a single string, the two original strings are unmodified. The += operator creates a new string that contains the combined contents. That new object is assigned to the variable s1, and the original object that was assigned to s1 is released for garbage collection because no other variable holds a reference to it.
string s1 = "First String ";
string s2 = "Second String";
// Concatenate s1 and s2. This actually creates a new
// string object and stores it in s1, releasing the
// reference to the original object.
s1 += s2;
System.Console.WriteLine(s1);
// Output: First String Second String.   Your Comment




More Software Questions..
What is the inputsplit in map reduce software?

What is software configuration management?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?

What are the minimum system requirements to run Photoshop? Is it possible to run Photoshop over linux?

Which oracle package is used to manage the oracle lock management services?

What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you avoid Latch Up?

What is marker interface?

What types of partitioning are there for BW?



Search
Can you Answer!!
  • Q What is the purpose of an elevator pitch ?
  • Q Carcase disposal by burial has been made illegal from the beginning of May, and a collection system will be introduced with final disposal by landfill, rendering or incineration. On farm incineration will still be permitted. Outline the benefits and disadvantages of these measures: a) for animal health b) for Public Health Illustrate your answer with examples
  • Q Which 18th century French philosopher wrote the opening line: 'Man is born free, and everywhere he is in chains.." ?
  • Q Can anybody help me with the estimation of cellulose, hemicellulose and lignin from BSG or any lignocellulosic materials?
  • Q For conduction of heat, the instantaneous rate of heat flow is product of three factors. What are these ?
  • Q What are the two airports awarded as Best Airports under National Tourism Awards 2015-16?
  • Q What is your retention strategy?
  • Q How is it possible to obtain the probability of emergence of a given genotype formed of more than one pair of different alleles with independent segregation from the knowledge of the parental genotypes?
  • Q Mandla Plant Fossils National Park situated in _____ state?
  • Q excessive formation and accumulation of gases in the intestine
  • Q What are the benefits of data integration?