Advertisement
wingman007

C#_OOP_1b_Inheritance_Athlete.cs

Apr 24th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace App1a
  8. {
  9.     class Athlete : Student
  10.     {
  11.         private string sport;
  12.  
  13.         public string Sport
  14.         {
  15.             get { return sport; }
  16.             set { sport = value; }
  17.         }
  18.  
  19.         public void TellYourSport()
  20.         {
  21.             Console.WriteLine("My sport is {0}", sport);
  22.         }
  23.  
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement