Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- List<Student>students = new List<Student>();
- students.Add(new Student(20));
- students.Add(new Student(30));
- students.Add(new Student(100));
- students.Add(new Student(50));
- foreach (Student s in students)
- {
- Console.WriteLine(s.Score);
- }
- Console.ReadKey(true);
- }
- }
- class Student
- {
- private int _score;
- public int Score { get; set; }
- public Student(int score)
- {
- _score = score;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement