コード例 #1
0
        static void Main(string[] args)
        {
            SomeClass sc = new SomeClass();

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

            ac.AbstractClassMethod();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: IndianaJim/CodeChallenges
        //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();
        }