Ogłoszenie


#16 2013-06-08 12:22:22

Michał Sobieralski

Cwiczenia grupa C

Zarejestrowany: 2012-10-13
Posty: 54
Punktów :   

Re: zad gr B

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

namespace ConsoleApplication3
{
    class PROGRAM{

        static void Main(string[] args){
            ZIEMIA B = new ZIEMIA(1111);
            Console.WriteLine("Masa={0}", B.MASA);
            KSIEZYC A = new KSIEZYC(0);
            Console.WriteLine("Masa={0}", A.MASA);
            Console.ReadLine();
        }


        abstract class PLANETA{

            private int PMASA;
            public PLANETA(int M) { PMASA = M; }
            public int MASA
            {
                get { return PMASA; }
                set { PMASA = value; }
            }
        }


        class ZIEMIA : PLANETA{

            public ZIEMIA() : this(0) { }
            public ZIEMIA(int M) : base(M) { }

        }


        class KSIEZYC : PLANETA{

            public KSIEZYC() : this(0) { }
            public KSIEZYC(int M) : base(M) { }

        }

    }
}


gr. C

Offline

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.raportywojenne.pun.pl www.psychologowie-umcs.pun.pl www.zadania.pun.pl www.havana.pun.pl www.akademiarw.pun.pl