static void Main(string[] args) { Rabbit iepureA = new Rabbit("Iepurila", EyesColor.Blue, FurColor.Grey, Genders.Female, DateTime.Now); iepureA.GetAge(); Console.WriteLine(iepureA); Rabbit iepureB = new Rabbit("Buggs", EyesColor.Red, FurColor.White, Genders.Male, new DateTime(2018, 01, 01)); iepureB.GetAge(); Console.WriteLine(iepureB); }
static void Main(string[] args) { Owner myOwner = new Owner("Gigi", "Dev", 47, "Ascunzatoare"); Rabbit myRabbit = new Rabbit(Eyes.Blue, Fur.Brown, Gender.Male, new DateTime(1999, 4, 4), myOwner); Console.WriteLine(myRabbit.Eyes); Console.WriteLine(myRabbit.Fur); Console.WriteLine(myRabbit.Gender); Console.WriteLine(myRabbit.Age); Console.WriteLine(myRabbit.Owner.First); Console.WriteLine(myRabbit.Owner.Last); Console.WriteLine(myRabbit.Owner.OwnerCode); Console.WriteLine(myRabbit.Owner.OwnerAddress); }
static void Main(string[] args) { Owner firstRabitOwner = new Owner("Florin", "Solo", "01", "Romania, bla bla"); Rabbit firstRabbit = new Rabbit(Eyes.Red, Fur.Black, Gender.Female, new DateTime(1999, 10, 2), firstRabitOwner); Console.WriteLine($"Eye color is: {firstRabbit.Eyes}\n" + $"Gender is: {firstRabbit.Gender}\n" + $"Fur color is: {firstRabbit.Fur}\n" + $"Birthday is: {firstRabbit.BirthDay.ToLongDateString()}\n" + $"Age is: {firstRabbit.Age}\n" + $"Owner is: {firstRabbit.Owner.FullName}\n" + $"The address of the owner is: {firstRabbit.Owner.Address}\n" + $"The code of the owner is: {firstRabbit.Owner.Code}"); firstRabbit.Move(); firstRabbit.Sleep(); firstRabbit.Eat(); // var myVar = new Counter() nu merge, deoarece static pe o clasa spune ca nu trebuie instantiat cu new, doar folosit var myVar = Counter.TVA; }