+ 1

C# references

Hey community! I've got a short question regarding C# i'll demonstrate with a code: class Person { int age {get;set;} } If i would now call the getter, would I get a reference to age or a copy?

25th May 2017, 2:42 PM
Daniel S
Daniel S - avatar
2 Respuestas
+ 1
You'll get a copy of the age property for each object of class Person that you instantiate.
25th May 2017, 4:25 PM
Álvaro
0
thanks, is there a way to return the reference
25th May 2017, 4:32 PM
Daniel S
Daniel S - avatar