.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

What's the advantage of using System.Text.StringBuilder over System.String?

Posted By :Gowthammanju     Posted Date :July 31, 2011    Points :40   Category :.NET Framework 
StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it's being operated on, a new instance is created.

You can also find related Interview Question to What's the advantage of using System.Text.StringBuilder over System.String?  below: 

What's the advantage of using System.Text.StringBuilder over System.String?

  
StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it's being operated on, a new instance is created. (More...)

What's the advantage of using System.Text.StringBuilder over System.String?

  
StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it's being operated on, a new instance is created. (More...)

What's the advantage of using System.Text.StringBuilder over System.String?

  
StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed, a new instance in memory is created. (More...)

Difference between System.String and System.StringBuilder classes?

  
-- System.String is immutable; System.StringBuilder can have mutable string where a variety of operations can be performed. (More...)

What is difference between System.String and System.StringBuilder classes?

  
String and StringBuilder classes are used to store string values but the difference in them is that String is immutable (read only) by nature, because a value once assigned to a String object cannot be changed after its creation. When the value in the String object is modified, a new object is created, in memory, with a new value assigned to the String object. On the other hand, the StringBuilder class is mutable, as it occupies the same space even if you change the value. The StringBuilder class is more efficient where you have to perform a large amount of string manipulation. (More...)

Consider the following code:

public class Example extends Thread
{
public void run()
{
System.out.println ("Hello");
}

public static void main (String args[])
{
new Example();
}
}

Select the correct option regarding the preceding code ?

  
1, The code will not compile.
2, The code will compile but will not execute.
3, The code will compile, execute, and display Hello as the output.
4, The code will compile, execute, but will not display anything.

Answer : 4 (More...)

Consider the following two classes:

public class Example1
{
public static int num;
static
{
num=5;
}
}


public class Example2
{
public static void main(String[] args)
{
System.out.println(Example1.num);
}
}

Select the correct option regarding the preceding classes.?

  
1, The Example2 class will execute without any output.
2, The Example2 class will execute with the following output:5

3, The Example2 class will not compile as it does not calls the constructor of the Example 1 class.
4, The Example2 class will not execute as it does not calls the constructor of the Example 1 class.

Answer : 2 (More...)

What is type system unification?

  
The goal of type system unification is to bridge the gap between value types and reference types that exists in most languages. For example, a Stack class can provide Push and Pop methods that take and return object values.

public class Stack
{
public object Pop() {...}
public void Push(object o) {...}
}
Because C# has a unified type system, the Stack class can be used with elements of any type, including value types like int. (More...)

What is the common type system (CTS)?

  
The common type system is a rich type system, built into the Common Language Runtime, that supports the types and operations found in most programming languages. The common type system supports the complete implementation of a wide range of programming languages. (More...)

What is a Database system?

  
The database and DBMS software together is called as Database system. (More...)

Disadvantage in File Processing System?

  
1.Data redundancy & inconsistency.
2.Difficult in accessing data.
3.Data isolation.
4.Data integrity.
5.Concurrent access is not possible.
6.Security Problems. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend