Exemple #1
0
        static void Main(string[] args)
        {
            SomeClass sc = new SomeClass();

            sc.AbstractClassMethod();
            AnotherClass ac = new AnotherClass();

            ac.AbstractClassMethod();
        }
Exemple #2
0
        //q: an abstract class has a default implementation for a method.
        //the method's default implementation is needed in some classes but not some other classes.
        //how can you acheive this?
        // answer: use "virtual" to allow override.

        static void Main(string[] args)
        {
            SomeClass sc = new SomeClass();

            sc.AbstractClassMethod();

            SomeOtherClass soc = new SomeOtherClass();

            soc.AbstractClassMethod();
        }