Ask bosses in c # Judge Person p1=new Person (18) ∥ Person is a reference type Person p1 p2= If p1 age=35 P2age is 35 A. to Wrong B Why choose to? Thank you for your bosses
CodePudding user response:
Because the Person is a reference type, that is, the class If it is a struct, so will not change,
CodePudding user response:
Because the Person is a reference type, Person p2=p1, Refer to the same address,
It is like a cup of milk tea, you insert 2 straw, A straw one mouthful tea, B straws in the absorption, milk tea has A bit of inside