static void Main() { bool debug = false; Person myPerson = new Person(); myPerson.Greet(); Student myStudent = new Student(); myStudent.SetAge(21); myStudent.Greet(); myStudent.ShowAge(); Teacher myTeacher = new Teacher(); myTeacher.SetAge(30); myTeacher.Greet(); myTeacher.Explain(); if (debug) { Console.ReadLine(); } Console.ReadKey(); }
static void Main() { bool debug = false; //Create a Person and make it say hello Person myPerson = new Person(); myPerson.Greet(); /*Create a student, set his age to 21, * tell him to Greet and display his age*/ Student myStudent = new Student(); myStudent.SetAge(21); myStudent.Greet(); myStudent.ShowAge(); /*Create a teacher, 30 years old, * ask him to say hello and then explain*/ Teacher myTeacher = new Teacher(); myTeacher.SetAge(30); myTeacher.Greet(); myTeacher.Explain(); if (debug) { Console.ReadLine(); } }
static void Main(string[] args) { Person person = new Person(); Person student = new Student(); Person teacher = new Teacher(30); person.SayHello(); student.SetAge(21); student.SayHello(); student.ShowAge(); teacher.SayHello(); teacher.Explain(); }
static void Main(string[] args) { Person p1 = new Person(); Student s1 = new Student(); Teacher t1 = new Teacher(); p1.Greet(); s1.SetAge(21); s1.Greet(); s1.ShowAge(); t1.SetAge(30); t1.Greet(); t1.Explain(); Console.ReadKey(); }
static void Main(string[] args) { Person ps = new Person(); ps.Hello(); Student st = new Student(); st.Hello(); st.SetAge(21); st.ShowAge(); Teacher tc = new Teacher(); tc.Hello(); tc.SetAge(30); tc.Explain(); }
static void Main(string[] args) { Person p = new Person(); p.Greet(); Student s = new Student(); s.SetAge(21); s.Greet(); s.ShowAge(); Teacher t = new Teacher(); t.SetAge(30); t.Greet(); t.Explain(); }
static void Main(string[] args) { Person p = new Student(); p.SayHello(); Student s1 = new Student(); s1.SetAge(21); s1.SayHello(); s1.ShowAge(); Teacher t = new Teacher(); t.SetAge(30); t.SayHello(); t.Explain(); }
static void Main(string[] args) { Person p = new Person("Lloyd"); p.Greet(); Student s = new Student("Alpha"); s.SetAge(20); s.Greet(); s.ShowAge(); Teacher t = new Teacher("Beta"); t.SetAge(30); t.Greet(); t.Explain(); Console.ReadKey(); }