Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
5
Answers
how to use a list as a property
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
George Loveless
14y
3k
1
Reply
This little bit of code wasn't working for me. I was wondering the proper way to use a list as a property, instead of setting it as a public member.
Class Company
{
..
private list<string> employees{get; set;}
..
}
..
..// in main.
Company myCompany = new Company();
myCompany.employees.add("jim"); // doesn't work
myCompany.employees.add("sue"); // doesn't work
Thank you much.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
about classes in C#
How to change system date format