Advertisement
desislava_topuzakova

Product

Jun 21st, 2020
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace ExamPreparation
  6. {
  7. class Product
  8. {
  9. private string name;
  10.  
  11. public Product() { }
  12. public Product(string name)
  13. {
  14. Name = name;
  15. }
  16.  
  17. public string Name
  18. {
  19. get
  20. {
  21. return name;
  22. }
  23. set
  24. {
  25. name = value;
  26. }
  27. }
  28.  
  29. public override string ToString()
  30. {
  31. return $"Product {name}";
  32. }
  33.  
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement