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

Is list immutable in c#?

870


What is the delegates in c#?

908


What is a value type in c#?

965


Explain what is copy constructor?

1019


What do you mean by directing?

979


What are the differences between value types and reference types?

1113


Can list contain duplicates c#?

878


Illustrate the differences between the system.array.copyto() and system.array.clone()?

975


What is method and function in c#?

987


What are the different types of comments in c#?

874


Write a program to create a user control with name and surname as data members and login as method and also the code to call it. (Hint use event delegates) Practical Example of Passing an Events to delegates

878


What is the execution entry point for a c# console application?

981


What is the difference between static and private constructor in c#?

1001


Can the nested class access, the containing class. Give an example?

877


Explain how do I convert a string to an int in c#?

969