Beispiel #1
0
        static void Main(string[] args)
        {
            Person p = new Person(1, "avi");

            p.Print();

            Console.WriteLine();
            Student s = new Student();

            s.Print();
            Console.WriteLine();

            SuperStudent supS  = new SuperStudent();
            SuperStudent supS2 = new SuperStudent(8);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Person p1 = new Person(2, "benny");

            p1.Print();
            p1.SetName("charlie");
            Console.WriteLine(p1.GetID());

            p1.SetID(18);
            p1.Id = 18; //Setter

            int res  = p1.GetID();
            int res2 = p1.Id;//Getter

            Console.WriteLine(p1.Id);

            Console.WriteLine(p1.GetName());
            //p1.Grade = 100;
            Console.WriteLine(p1.Grade);
            p1.Address = "asdasdasd";
            //Console.WriteLine(p1.Address);
            Console.WriteLine(p1.Age);
        }