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;
- using System.IO;
- namespace test
- {
- class Class1
- {
- public virtual void Metoda()
- {
- Console.Write("Metoda1");
- }
- }
- class Class2:Class1
- {
- public override void Metoda()
- {
- Console.Write("Metoda2");
- }
- }
- /* public static void Main()
- {
- Class2 obj2 = new Class2();
- obj2.Metoda();
- Console.Write(",");
- Class1 obj1 = (Class1)obj2;
- obj1.Metoda();
- }*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement