Skip to content

Instantly share code, notes, and snippets.

@pinda
Last active January 13, 2016 15:01
Show Gist options
  • Save pinda/d77e24a095ab2df61cda to your computer and use it in GitHub Desktop.
Save pinda/d77e24a095ab2df61cda to your computer and use it in GitHub Desktop.
Inheritance
public class Bar {
public string Baz;
public Bar(int x)
{
// Do something here
}
}
public class Foo : Bar {
// Is this the best practice?
// Or is there a way without this?
// What if I have 10 classes extending Bar
public Foo(int x) : base(x) { }
}
// Want to do: new Foo(10);
// Would like to keep new Foo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment