-
-
Save pinda/d77e24a095ab2df61cda to your computer and use it in GitHub Desktop.
Inheritance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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