Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyBase
- {
- public virtual string Hai()
- {
- return "Saya base class";
- }
- }
- class MyDerived : MyBase
- {
- // Overrides the virtual method menggunakan override keyword:
- public override string Hai()
- {
- return "Saya derived class";
- }
- public static void Main()
- {
- MyDerived mD = new MyDerived();
- System.Console.WriteLine(mD.Hai());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment