Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace poliformizmusperson
- {
- class Person
- {
- protected string firstName;
- protected string lastName;
- public Person()
- {
- }
- public Person(string fn, string ln)
- {
- firstName = fn;
- lastName = ln;
- }
- public void displayFullName()
- {
- Console.WriteLine("{0} {1}", firstName, lastName);
- }
- }
- class Employe : Person
- {
- public ushort hireYear;
- public Employe()
- : base()
- {
- }
- public Employe(string fn, string ln)
- : base(fn, ln)
- {
- }
- public Employe(string fn, string ln, ushort hy)
- : base(fn, ln)
- {
- hireYear = hy;
- firstName = fn;
- lastName = ln;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Employe me = new Employe("Zsótár", "Csaba", 1983);
- Person Brad = me;
- me.displayFullName();
- Console.WriteLine("Year hired: {0}", me.hireYear);
- Brad.displayFullName();
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement