Advertisement
Guest User

Untitled

a guest
Feb 14th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace InheritanceAndPolymorphism
  6. {
  7. public class LocalCourse : Course
  8. {
  9. public string Lab { get; set; }
  10.  
  11. public LocalCourse(string courseName, string teacherName = null, IList<string> students = null)
  12. : base(courseName, teacherName, students)
  13. {
  14. this.Lab = null;
  15. }
  16.  
  17. public override string ToString()
  18. {
  19. StringBuilder result = new StringBuilder(base.ToString());
  20. if (this.Lab != null)
  21. {
  22. result.Append("; Lab = ");
  23. result.Append(this.Lab);
  24. }
  25. result.Append(" }");
  26. return result.ToString();
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement