Guest User

Untitled

a guest
Mar 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. using System;
  2.  
  3. namespace capp_08_03_2018
  4. {
  5. class Musteri
  6. {
  7. string isim;
  8. int gun, ay, yil;
  9. public int[] DogumTarihi
  10. {
  11. get
  12. {
  13. return new int[] { gun, ay, yil };
  14. }
  15. set
  16. {
  17. gun = value[0];
  18. ay = (value.Length > 1) ? value[1] : ay;
  19. yil = (value.Length > 2) ? value[2] : yil;
  20. }
  21. }
  22. public string Isim
  23. {
  24. get
  25. {
  26. return isim;
  27. }
  28. }
  29. public Musteri(string isim = "İsimsiz")
  30. {
  31. this.isim = isim;
  32. }
  33. }
  34. class Program
  35. {
  36. static void Main(string[] args)
  37. {
  38. Musteri musteri1 = new Musteri("Mahmut");
  39. musteri1.DogumTarihi = new int[] { 5, 8, 1999, 12, 6 };
  40. musteri1.DogumTarihi = new int[] { 12, 4 };
  41. Console.WriteLine("{0} -> {1}/{2}/{3}", musteri1.Isim, musteri1.DogumTarihi[0], musteri1.DogumTarihi[1], musteri1.DogumTarihi[2]);
  42. }
  43. }
  44. }
Add Comment
Please, Sign In to add comment