Skip to content

Instantly share code, notes, and snippets.

Created September 20, 2016 07:15
Show Gist options
  • Select an option

  • Save anonymous/2d1770500fa7530f704c361bd8f303e8 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/2d1770500fa7530f704c361bd8f303e8 to your computer and use it in GitHub Desktop.
/*********
* This Gist was created at CSharpPad.com
* To run this file, open http://csharppad.com/gist/f075352ee464c737ee84d5545655c7a7
**********/
public class Person
{
public string Name { get; set; }
private int _age;
public int Age
{
get { return _age; }
set { _age = value; }
}
public Person(string name, int age)
{
Name = name;
Age = age;
}
}
public class ChatPerson: Person
{
private const string DefaultMessage = "default message";
private string _message;
public ChatPerson(string name, int age) : base(name, age)
{
_message = DefaultMessage;
}
public ChatPerson(string message) : this("John", 42)
{
_message = message;
}
}
var person = new ChatPerson("hello");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment