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

            p.GetDate();
            p.DoPrint();

            Console.ReadKey();
        }
コード例 #2
0
        private static void UsingBaseExample()
        {
            PrePaidInvoice p = new PrePaidInvoice();

            p.GetDate();

            /* When the DoPrint method is called on an instance of the PrePaidInvoice class, it first
             * makes a call of the DoPrint method in the parent object. */
            p.DoPrint();
        }
コード例 #3
0
        public static void executeTest()
        {
            invoice c = new invoice();

            c.getDate();
            c.DoPrint();
            Console.ReadKey();
            PrePaidInvoice p = new PrePaidInvoice();

            p.getDate();
            p.DoPrint();
            Console.ReadKey();
        }
コード例 #4
0
        public static void RunMethodOverriding()
        {
            //create an invoice
            Invoice        receipt = new Invoice();
            PrePaidInvoice p       = new PrePaidInvoice();

            receipt.GetDate(); //set date method from Document

            receipt.DoPrint(); //do print method from Invoice

            //  p.GetDate();
            p.DoPrint();

            Console.ReadLine();
        }
コード例 #5
0
        // The	use	of	method	overriding	allows	the	behavior	of	different	items	to	be customized	for	each	particular	item,
        // and	you	can	also	re-use	code	in	parent objects	by	using	the	base	keyword.
        public void BaseCall()
        {
            PrePaidInvoice p = new PrePaidInvoice();

            p.DoPrint();
        }