Skip to content

Instantly share code, notes, and snippets.

@nikmd23
Created May 28, 2014 11:15
Show Gist options
  • Save nikmd23/6440e12f800580b2c8ff to your computer and use it in GitHub Desktop.
Save nikmd23/6440e12f800580b2c8ff to your computer and use it in GitHub Desktop.
.NET Fiddle
class Person
{
public Person(string name = "Joe Somebody")
{
Name = name;
}
public string Name { get; private set; }
public string Greet()
{
if (Name == null)
return "Hello, stranger!";
return string.Format("Hello, {0}!", Name);
}
}
Console.WriteLine(new Person().Greet());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment