Lets say i have the following code where Car class has only 1 property : String modelname
Car c = new Car("toyota");
Car c1 = c;
Car c2 = c;
Car c3 = c;
Car c4 = c;
Car c5 = c;
Is this going to make a new copy of car c every time ? So there will be a new "toyota" String 5 times more in the memory ? Or the "toyota" string will be in the memory only once ?
Edit: Adding this relevant link in case you had the same question as i did, i think it helps Are arrays or lists passed by default by reference in c#?