gmcconville
New member
- Joined
- Jul 21, 2015
- Messages
- 2
- Programming Experience
- 10+
Good afternoon.
Can someone please let me know if you can treat a class as a property?
Like this...
.... Other code
I realize I can just make the name value public, but this purely more curiosity, if you access a variable in a class by only referencing the class
Can someone please let me know if you can treat a class as a property?
Like this...
public class person { private string name; public string Sex; public person() { get { return person; } set { person = value; } } }
.... Other code
person Sarah = new person() Sarah.Sex = "Female" string customername = Sarah
I realize I can just make the name value public, but this purely more curiosity, if you access a variable in a class by only referencing the class
Last edited by a moderator: