Created
April 27, 2013 17:52
-
-
Save yesez/5473951 to your computer and use it in GitHub Desktop.
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
using System; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var nieto = new Nieto(); | |
Console.WriteLine(nieto.Sumar(1, 3)); | |
Console.ReadKey(); | |
} | |
} | |
public class Abuelo | |
{ | |
public int Sumar(int num1, int num2) | |
{ | |
return num1 + num2; | |
} | |
} | |
public class Padre:Abuelo | |
{ | |
public int Restar(int num1, int num2) | |
{ | |
return num1 - num2; | |
} | |
} | |
public class Nieto:Padre | |
{ | |
public int Multiplicar(int num1, int num2) | |
{ | |
return num1 * num2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment