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

What is the default value of boolean variable?

974


what is inheritance and an example in vb.net and c# of when you might use it?

952


What are managed providers?

1015


What is the difference between proc. Sent by val and by sub?

995


What is .cs file in c#?

926


What is difference between destructor and finalize?

931


Explain the difference between a struct and a class?

957


How do you declare an arraylist?

987


I was trying to use an out int parameter in one of my functions. How should I declare the variable that I am passing to it?

987


Explain the importance and use of each, version, culture and publickeytoken for an assembly.

932


What is inheritance in csharp?

1008


What are the principles of delegation?

940


Can an interface extend a class c#?

960


Explain the difference between “as” and “is” operators used in c#?

962


What is a di class?

1084