Advertisement
EricGiangPhu

BaiTap1_Nghia

Dec 12th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.21 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 Demo
  8. {
  9.     interface IStudent
  10.     {
  11.         void SayHi();
  12.         void SayBye();
  13.     }
  14.     interface ICode
  15.     {
  16.         void SayHi();
  17.         void MakeGame();
  18.     }
  19.     interface IArt
  20.     {
  21.         void SayHi();
  22.         void Draw();
  23.     }
  24.     public abstract class Unity
  25.     {
  26.         public abstract void Play();
  27.         public abstract void Pause();
  28.         int time;
  29.     }
  30.     public class A:IStudent,ICode,IArt
  31.     {
  32.         void IStudent.SayHi()
  33.         { }
  34.         public void SayBye()
  35.         { }
  36.         void ICode.SayHi()
  37.         { }
  38.         public void MakeGame()
  39.         { }
  40.         void IArt.SayHi()
  41.         { }
  42.         public void Draw()
  43.         { }
  44.     }
  45.     public class B:Unity
  46.     {
  47.         public override void Play()
  48.         { }
  49.         public sealed override void Pause()
  50.         { }
  51.         public virtual void Stop()
  52.         {
  53.             Console.WriteLine("Stop");
  54.         }
  55.     }
  56.     public class C:B
  57.     {
  58.         public override void Stop()
  59.         {
  60.             Console.WriteLine("Please Stop!!!");
  61.         }
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement