Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace World3a3b
- {
- class Student : Person
- {
- // public string Name { get; set; }
- private int fNumber;
- public int FNumber
- {
- get { return fNumber; }
- set { fNumber = value; }
- }
- /*
- public Student()
- :base()
- { }
- */
- public Student(string name, int age, int fNumber)
- :base(name, age) // :base()
- {
- this.fNumber = fNumber;
- }
- // public void IntroduceYourSelfStudent()
- // public new void IntroduceYourSelf() // hiding
- public override void IntroduceYourSelf() // override
- {
- Console.WriteLine("---------- Student ------------------");
- // Console.WriteLine("My name is {0}. I am {1} yers old. My balance is {2}. I am {3}. fNumber = {4}", name, age, Balance, nationality, fNumber);
- base.IntroduceYourSelf();
- Console.WriteLine("fNumber = {0}", fNumber);
- Console.WriteLine("----------------- End -------------");
- }
- public override string ToString()
- {
- return base.ToString() + " fNumber = " + fNumber;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement