Niekon
❔ Why can't I reinitialize an object inside a function?
Hi, I created an object in Program.cs file, and passed it as a parameter in a function. If I change the value of a property in the object, it reflects back in Program.cs as well, but if I reinitialize the object, the object reverts to its original values when back in Program.cs. Why is this happening?
Program.cs
PersonMethods.cs
Output
15 replies