using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace V1
{
    class Program
    {
        static void Main(string[] args)
        {
            A a1 = new A();
            A a2 = new B();
            a1.Methode1();
            a1.Methode2();
            a2.Methode1();
            a2.Methode2();
            Console.Read();
        }
    }

    class A
    {
        public void Methode1()
        {
            Console.WriteLine("Klasse A, Methode1");
        }

        public virtual void Methode2()
        {
            Console.WriteLine("Klasse A, Methode2");
        }
    }

    class B : A
    {
        public new void Methode1()
        {
            Console.WriteLine("Klasse B, Methode1");
        }

        sealed public override void Methode2()
        {
            Console.WriteLine("Klasse B, Methode2");
        }
    }

    abstract class AbstractClass
    {
        public abstract int Sum(int a, int b);
    }

    class DerivedClass : AbstractClass
    {
        public override int Sum(int a, int b)
        {
            return a + b;
        }
    }
}
