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 _3b
- {
- abstract class Telephone
- {
- protected string phonetype;
- public abstract void Ring();
- }
- class DigitalPhone : Telephone
- {
- public DigitalPhone()
- {
- this.phonetype = "Digital";
- }
- public override void Ring()
- {
- Console.WriteLine("Dzwoni w chuj " + this.phonetype);
- }
- }
- class TalkingPhone : Telephone
- {
- public TalkingPhone()
- {
- this.phonetype = "Talking";
- }
- public override void Ring()
- {
- Console.WriteLine("Dzwoni w chuj " + this.phonetype);
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- DigitalPhone EP1 = new DigitalPhone();
- TalkingPhone EP2 = new TalkingPhone();
- EP1.Ring();
- EP2.Ring();
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement