Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Is string reference type / value type?

Answer Posted / who am i

how do you explain this?

private void MyTest()
{
MyClass myClass = new MyClass();
myClass.value = 1;
MessageBox.Show(myClass.value.ToString()); //1
MyClass newClass = myClass;

newClass.value = 2;
MessageBox.Show(myClass.value.ToString()); //2


String myStr = new String("1".ToCharArray());

MessageBox.Show(myStr); //1
String newStr = myStr;

newStr = "2";
MessageBox.Show(myStr); //1 -- Shouldn't it
display 2???
}

public class MyClass
{
public int value=0;

}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between abstract class and interface.

1115


How is a strongly-named assembly different from one that isn’t strongly-named?

1025


What is private protected in c#?

852


Which namespaces are necessary to create a localized application?

1029


What is windows forms in c#?

883


What does the parsefloat function do?

881


What is the difference between structure and class in c#?

921


Why do we need nullable types in c#?

1127


What is a delegate in c#?

905


Why do we override in c#?

844


Is boxing an implicit conversion?

989


Can properties be private in c#?

868


What are the fundamental differences between value types and reference types?

1028


How does inheritance work in c#?

1082


Explain how to use an extender provider in the project.

937