Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _3b
  8. {
  9. abstract class Telephone
  10. {
  11. protected string phonetype;
  12. public void Ring()
  13. {
  14. Console.WriteLine("Dzwoni " + this.phonetype);
  15. }
  16. }
  17. class DigitalPhone : Telephone
  18. {
  19. public DigitalPhone()
  20. {
  21. this.phonetype = "Digital";
  22. }
  23. public void Ring()
  24. {
  25. Console.WriteLine("Dzwoni w chuj " + this.phonetype);
  26. }
  27. }
  28. class TalkingPhone : Telephone
  29. {
  30. public TalkingPhone()
  31. {
  32. this.phonetype = "Talking";
  33. }
  34. public void Ring()
  35. {
  36. Console.WriteLine("Dzwoni w chuj " + this.phonetype);
  37. }
  38. }
  39. class Program
  40. {
  41. static void Main(string[] args)
  42. {
  43. DigitalPhone EP1 = new DigitalPhone();
  44. TalkingPhone EP2 = new TalkingPhone();
  45. EP1.Ring();
  46. EP2.Ring();
  47. Console.ReadKey();
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement