Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace capp_08_03_2018
- {
- class Musteri
- {
- string isim;
- int gun, ay, yil;
- public int[] DogumTarihi
- {
- get
- {
- return new int[] { gun, ay, yil };
- }
- set
- {
- gun = value[0];
- ay = (value.Length > 1) ? value[1] : ay;
- yil = (value.Length > 2) ? value[2] : yil;
- }
- }
- public string Isim
- {
- get
- {
- return isim;
- }
- }
- public Musteri(string isim = "İsimsiz")
- {
- this.isim = isim;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Musteri musteri1 = new Musteri("Mahmut");
- musteri1.DogumTarihi = new int[] { 5, 8, 1999, 12, 6 };
- musteri1.DogumTarihi = new int[] { 12, 4 };
- Console.WriteLine("{0} -> {1}/{2}/{3}", musteri1.Isim, musteri1.DogumTarihi[0], musteri1.DogumTarihi[1], musteri1.DogumTarihi[2]);
- }
- }
- }
Add Comment
Please, Sign In to add comment