Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5. List<Student>students = new List<Student>();
  6. students.Add(new Student(20));
  7. students.Add(new Student(30));
  8. students.Add(new Student(100));
  9. students.Add(new Student(50));
  10. foreach (Student s in students)
  11. {
  12. Console.WriteLine(s.Score);
  13. }
  14. Console.ReadKey(true);
  15. }
  16. }
  17.  
  18. class Student
  19. {
  20. private int _score;
  21. public int Score { get; set; }
  22.  
  23. public Student(int score)
  24. {
  25. _score = score;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement