Example #1
0
        static void Main(string[] args)
        {
            Console.WriteLine();
            Console.WriteLine("Konsep Abstraksi Menggunakan Abstract Class. ");
            Console.WriteLine();

            tumbuhan Tumbuhan;

            Tumbuhan = new monokotil();
            Tumbuhan.jenisTumbuhan();

            Tumbuhan = new dikotil();
            Tumbuhan.jenisTumbuhan();

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Konsep Abstraksi Menggunakan Interface. ");
            Console.WriteLine();

            IAdaptasi adaptasi;

            adaptasi = new hidrofit();
            adaptasi.tempatHidupTumbuhan();

            adaptasi = new higrofit();
            adaptasi.tempatHidupTumbuhan();

            adaptasi = new xerofit();
            adaptasi.tempatHidupTumbuhan();


            Console.ReadKey();
        }
Example #2
0
        static void Main(string[] args)
        {
            Console.WriteLine();
            Console.WriteLine("Konsep Abstraksi Menggunakan Abstract Class. ");
            Console.WriteLine();
            tumbuhan Tumbuhan;

            Tumbuhan = new xerofit();
            Tumbuhan.TempatHidup();

            Tumbuhan = new hidrofit();
            Tumbuhan.TempatHidup();

            Tumbuhan = new higrofit();
            Tumbuhan.TempatHidup();

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Konsep Abstraksi Menggunakan Interface. ");
            Console.WriteLine();
            IReproduksi reproduksiTumbuhan;

            reproduksiTumbuhan = new generatif();
            reproduksiTumbuhan.berkembangBiak();

            reproduksiTumbuhan = new vegetatif();
            reproduksiTumbuhan.berkembangBiak();

            Console.ReadKey();
        }