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;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- A c = new B();
- c.ver();
- }
- }
- class A
- {
- public virtual void ver()
- {
- Console.WriteLine("ver 1");
- }
- }
- class B:A
- {
- public override void ver()
- {
- Console.WriteLine("ver 2");
- }
- }
- }
Add Comment
Please, Sign In to add comment