C# Inheritance
Basic Inheritance public class Animal{ public void Greet() { Console.WriteLine("Hello, I'm some sort of animal!"); }} public class Dog : Animal{ } Animal animal = new Animal(); animal.Greet(); Dog dog = new Dog(); dog.Greet();
Basic Inheritance public class Animal{ public void Greet() { Console.WriteLine("Hello, I'm some sort of animal!"); }} public class Dog : Animal{ } Animal animal = new Animal(); animal.Greet(); Dog dog = new Dog(); dog.Greet();
The following access modifiers are available: C# Modifier Definition public The type or member can be accessed by any other code in the same assembly or another assembly that references it. private The type or member can only be accessed by code in the same class. protected The type or member can only be accessed... » read more
DateTime.UtcNow tells you the date and time as it would be in Coordinated Universal Time, aka Greenwich Mean Time time zone. Basically the time as if you are in London England. DateTime.Now gives the date and time as it would appear to someone in your current locale. It is better to store DateTime.UtcNow then DateTime.Now... » read more