OKIEWARDOYO

C#.NET No.9-3

Dec 19th, 2012
5,137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. interface IMyInterface
  2. {
  3.     void MethodToImplement();
  4.     void MethodYgLain();
  5. }
  6. class ClassKita : IMyInterface
  7. {
  8.     public void MethodToImplement()
  9.     {
  10.         Console.WriteLine("MethodToImplement() dieksekusi.");
  11.     }
  12.     public void MethodYgLain()
  13.     {
  14.         Console.WriteLine("MethodYgLain() dieksekusi.");
  15.     }
  16. }
  17.  
  18. //Updated 25 August 14
  19. class Program
  20. {
  21.     static void Main()
  22.     {
  23.     IMyInterface im = new ClassKita(); // Create instance.
  24.     im.MethodToImplement(); // Call method on interface.
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment