public static void Main(string[] args) { Student student = new Student(); student.InitStudent("Madeleine", "Cather"); // Output the banner and name statically. Student.OutputBanner(); Student.OutputName(student); Console.WriteLine(); // Output the banner and name again using instance. student.OutputBannerAndName(); // Wait for user to acknowledge. Console.WriteLine("Press Enter to terminate..."); Console.Read(); }
// OutputName - Output the student's name. public static void OutputName(Student student) { // Here the Student object is referenced explicitly. Console.WriteLine("Student's name is {0}", student.ToNameString()); }