GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  DotNet
Go To First  |  Previous Question  |  Next Question 
 DotNet  |  Question 143 of 165    Print  
What is the difference between string class and stringbuilder class?

  
Total Answers and Comments: 2 Last Update: December 02, 2007     Asked by: sudhakar 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 10, 2007 02:58:58   #1  
hanumesh_06 Member Since: August 2007   Contribution: 2    

RE: What is the difference between string class and st...
string class in immutable. Immutable is nothing but the value assigned to string cannot be changed.


Stringbuilder class is mutable. mutable is nothing but the value assigned to stringbuilder can be changed.


 
Is this answer useful? Yes | No
December 02, 2007 10:44:21   #2  
maverick_dude Member Since: November 2007   Contribution: 15    

RE: What is the difference between string class and stringbuilder class?
String is immutable where as stringbuilder is mutable.

That means: The value in a string can not be modified once it has been created. When you modify a string in your code it actually creates a new string with the modified value and the string object only starts to reference this new (modified) string. That is why .Net has System.Text.StringBuilder class (to modify the string). So if you need to change the value in your string heavily you should use the StringBuilder.

But you should not use the StringBuilder everytime as it will take a toll on the performance of your application

 
Is this answer useful? Yes | No

 Related Questions

CLR is .NET equivalent of Java Virtual Machine (JVM). It is the runtime that converts a MSIL code into the host machine language code, which is then executed appropriately. The CLR is the execution 
Latest Answer : CLR - Common Language Runtime...Its a virtual machine of Microsoft's .Net,During Compile time the Source code(C#,VB.Net..) is converted into Intermediate Language (MSIL),During Runtime this IL is converted to native code to Operating System by ...

Latest Answer : C# ...

What is the difference between Servers? Transfer and Response. Redirect? Why would I choose one over the other?

Latest Answer : In ADO, the in-memory representation of data is the recordset. In ADO.NET, it is the dataset. There are important differences between them. A recordset looks like a single table. If a recordset is to contain data from multiple database tables, ...

Describe the difference between inline and code behind - which is best in a loosely coupled solution.

Latest Answer : System.Web.UI.page ...

Latest Answer : Dataset:-Data set is the Disconneted data Architecture.Datareader:- Datareader is the connected Data Architecture. ...

It is a Framework in which Windows applications may be developed and run.The Microsoft .NET Framework is a platform for building, deploying, and running Web Services and applications. It provides a highly 
Latest Answer : .Net framework is a platform for building, deploying and running web services and other applications. It provides memory management and a rich set of classes.It facilitates integration of code written in several .net languages into one assembly. It provides ...

CTS defines all of the basic types that can be used in the .NET Framework and the operations performed on those type. All this time we have been talking about language interoperability, and .NET 
Latest Answer : CTS, common type system is the one which brings all .net languages data types on a common platform. It defines types like System.Int16, System.Int32 etc. A language may map 'int' to System.Int16 while another may map its 'int' data type to System.Int32.Because ...

A namespace is a logical naming scheme for types in which a simple type name, such as MyType, is preceded with a dot-separated hierarchical name. Such a naming scheme is completely under control of 
Latest Answer : Namespace - It is a logical group of classes means it defines boundary for classes. In a single program 2 namespace cannot be have same name. Assemblies - These physical structure of coding and it can store manifest (metadata). Assembly can be ...


 Sponsored Links

 
Related Articles

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

C++ String Representation and Handling

C String Representation and Handling In this C tutorial you will learn about string representation and handling how is string represented end string notation initializing char array character representation string literals example programe to understand the character array concept and the accessing
 

How to Access C++ Class Members

How to Access C Class Members In this C tutorial you will learn how to access Class members dot operator or class member access operator difference between struct and class and  scope resolution operator mosgoogle center It is possible to access the class members after a class is defined an
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 

Convert a String into an Integer

How to convert a string into an integer in C program? This is done by using the function named as atoi(). This function atoi() is present in the header file named as <stdlib.h>. When programmers use this function they must include the header file by the statement #include <stdl
 

String handling functions

What is the string handling functions present in header file <string.h>? There are number of string handling functions present in string.h. In other words if a programmer uses any of the function present in string.h then they must include the header file as #include <string.h&am
 

Convert a String into Long Value

What string function is used to convert a string into long value? This is done by using the function named as atol() . This function atol() is present in the header file named as <stdlib.h>. When programmers use this function they must include the header file by the statement
 

What is difference between call by value and call by reference in function?

The arguments passed to function can be of two types 1. Values passed 2. Address passed The first type refers to call by value and the second type refers to call by reference. For instance consider program1 main() { int x=50, y=70; interchange(x,y); printf(“x=%d y=%d”,x,
 

Base Address of the String

What happens when we try to change the value of base address of the string? The base address of the sting takes a special place in the context of strings. This is because suing this base address only the string gets identified. In other words the base address therefore takes the position of constant
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape